@@ -19,7 +19,7 @@ use super::{sockaddr_un, SocketAddr};
1919 target_os = "netbsd" ,
2020 target_os = "openbsd" ,
2121) ) ]
22- use crate :: io:: IoSliceMut ;
22+ use crate :: io:: { IoSlice , IoSliceMut } ;
2323use crate :: net:: Shutdown ;
2424use crate :: os:: unix:: io:: { AsRawFd , FromRawFd , IntoRawFd , RawFd } ;
2525use crate :: path:: Path ;
@@ -506,23 +506,24 @@ impl UnixDatagram {
506506 /// ```no_run
507507 /// #![feature(unix_socket_ancillary_data)]
508508 /// use std::os::unix::net::{UnixDatagram, SocketAncillary};
509- /// use std::io::IoSliceMut ;
509+ /// use std::io::IoSlice ;
510510 ///
511511 /// fn main() -> std::io::Result<()> {
512512 /// let sock = UnixDatagram::unbound()?;
513- /// let mut buf1 = [1; 8];
514- /// let mut buf2 = [2; 16];
515- /// let mut buf3 = [3; 8];
516- /// let mut bufs = &mut [
517- /// IoSliceMut ::new(&mut buf1),
518- /// IoSliceMut ::new(&mut buf2),
519- /// IoSliceMut ::new(&mut buf3),
513+ /// let buf1 = [1; 8];
514+ /// let buf2 = [2; 16];
515+ /// let buf3 = [3; 8];
516+ /// let bufs = &[
517+ /// IoSlice ::new(&buf1),
518+ /// IoSlice ::new(&buf2),
519+ /// IoSlice ::new(&buf3),
520520 /// ][..];
521521 /// let fds = [0, 1, 2];
522522 /// let mut ancillary_buffer = [0; 128];
523523 /// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
524524 /// ancillary.add_fds(&fds[..]);
525- /// sock.send_vectored_with_ancillary_to(bufs, &mut ancillary, "/some/sock").expect("send_vectored_with_ancillary_to function failed");
525+ /// sock.send_vectored_with_ancillary_to(bufs, &mut ancillary, "/some/sock")
526+ /// .expect("send_vectored_with_ancillary_to function failed");
526527 /// Ok(())
527528 /// }
528529 /// ```
@@ -538,7 +539,7 @@ impl UnixDatagram {
538539 #[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
539540 pub fn send_vectored_with_ancillary_to < P : AsRef < Path > > (
540541 & self ,
541- bufs : & mut [ IoSliceMut < ' _ > ] ,
542+ bufs : & [ IoSlice < ' _ > ] ,
542543 ancillary : & mut SocketAncillary < ' _ > ,
543544 path : P ,
544545 ) -> io:: Result < usize > {
@@ -554,23 +555,24 @@ impl UnixDatagram {
554555 /// ```no_run
555556 /// #![feature(unix_socket_ancillary_data)]
556557 /// use std::os::unix::net::{UnixDatagram, SocketAncillary};
557- /// use std::io::IoSliceMut ;
558+ /// use std::io::IoSlice ;
558559 ///
559560 /// fn main() -> std::io::Result<()> {
560561 /// let sock = UnixDatagram::unbound()?;
561- /// let mut buf1 = [1; 8];
562- /// let mut buf2 = [2; 16];
563- /// let mut buf3 = [3; 8];
564- /// let mut bufs = &mut [
565- /// IoSliceMut ::new(&mut buf1),
566- /// IoSliceMut ::new(&mut buf2),
567- /// IoSliceMut ::new(&mut buf3),
562+ /// let buf1 = [1; 8];
563+ /// let buf2 = [2; 16];
564+ /// let buf3 = [3; 8];
565+ /// let bufs = &[
566+ /// IoSlice ::new(&buf1),
567+ /// IoSlice ::new(&buf2),
568+ /// IoSlice ::new(&buf3),
568569 /// ][..];
569570 /// let fds = [0, 1, 2];
570571 /// let mut ancillary_buffer = [0; 128];
571572 /// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
572573 /// ancillary.add_fds(&fds[..]);
573- /// sock.send_vectored_with_ancillary(bufs, &mut ancillary).expect("send_vectored_with_ancillary function failed");
574+ /// sock.send_vectored_with_ancillary(bufs, &mut ancillary)
575+ /// .expect("send_vectored_with_ancillary function failed");
574576 /// Ok(())
575577 /// }
576578 /// ```
@@ -586,7 +588,7 @@ impl UnixDatagram {
586588 #[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
587589 pub fn send_vectored_with_ancillary (
588590 & self ,
589- bufs : & mut [ IoSliceMut < ' _ > ] ,
591+ bufs : & [ IoSlice < ' _ > ] ,
590592 ancillary : & mut SocketAncillary < ' _ > ,
591593 ) -> io:: Result < usize > {
592594 send_vectored_with_ancillary_to ( & self . 0 , None , bufs, ancillary)
0 commit comments