Remove leading :: from paths in doc examples
This commit is contained in:
parent
857a55b8f0
commit
040d88dda1
5 changed files with 11 additions and 11 deletions
|
@ -167,7 +167,7 @@ pub trait FromIterator<A>: Sized {
|
||||||
/// // and we'll implement IntoIterator
|
/// // and we'll implement IntoIterator
|
||||||
/// impl IntoIterator for MyCollection {
|
/// impl IntoIterator for MyCollection {
|
||||||
/// type Item = i32;
|
/// type Item = i32;
|
||||||
/// type IntoIter = ::std::vec::IntoIter<Self::Item>;
|
/// type IntoIter = std::vec::IntoIter<Self::Item>;
|
||||||
///
|
///
|
||||||
/// fn into_iter(self) -> Self::IntoIter {
|
/// fn into_iter(self) -> Self::IntoIter {
|
||||||
/// self.0.into_iter()
|
/// self.0.into_iter()
|
||||||
|
|
|
@ -76,7 +76,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
|
||||||
/// ```
|
/// ```
|
||||||
/// # #![feature(dispatch_from_dyn, unsize)]
|
/// # #![feature(dispatch_from_dyn, unsize)]
|
||||||
/// # use std::{ops::DispatchFromDyn, marker::Unsize};
|
/// # use std::{ops::DispatchFromDyn, marker::Unsize};
|
||||||
/// # struct Rc<T: ?Sized>(::std::rc::Rc<T>);
|
/// # struct Rc<T: ?Sized>(std::rc::Rc<T>);
|
||||||
/// impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Rc<U>> for Rc<T>
|
/// impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Rc<U>> for Rc<T>
|
||||||
/// where
|
/// where
|
||||||
/// T: Unsize<U>,
|
/// T: Unsize<U>,
|
||||||
|
|
|
@ -176,7 +176,7 @@ Section: Creating a string
|
||||||
/// ```
|
/// ```
|
||||||
/// fn from_utf8_lossy<F>(mut input: &[u8], mut push: F) where F: FnMut(&str) {
|
/// fn from_utf8_lossy<F>(mut input: &[u8], mut push: F) where F: FnMut(&str) {
|
||||||
/// loop {
|
/// loop {
|
||||||
/// match ::std::str::from_utf8(input) {
|
/// match std::str::from_utf8(input) {
|
||||||
/// Ok(valid) => {
|
/// Ok(valid) => {
|
||||||
/// push(valid);
|
/// push(valid);
|
||||||
/// break
|
/// break
|
||||||
|
@ -184,7 +184,7 @@ Section: Creating a string
|
||||||
/// Err(error) => {
|
/// Err(error) => {
|
||||||
/// let (valid, after_valid) = input.split_at(error.valid_up_to());
|
/// let (valid, after_valid) = input.split_at(error.valid_up_to());
|
||||||
/// unsafe {
|
/// unsafe {
|
||||||
/// push(::std::str::from_utf8_unchecked(valid))
|
/// push(std::str::from_utf8_unchecked(valid))
|
||||||
/// }
|
/// }
|
||||||
/// push("\u{FFFD}");
|
/// push("\u{FFFD}");
|
||||||
///
|
///
|
||||||
|
|
|
@ -202,7 +202,7 @@ impl UdpSocket {
|
||||||
///
|
///
|
||||||
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
|
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
|
||||||
/// assert_eq!(socket.peer_addr().unwrap_err().kind(),
|
/// assert_eq!(socket.peer_addr().unwrap_err().kind(),
|
||||||
/// ::std::io::ErrorKind::NotConnected);
|
/// std::io::ErrorKind::NotConnected);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "udp_peer_addr", since = "1.40.0")]
|
#[stable(feature = "udp_peer_addr", since = "1.40.0")]
|
||||||
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
|
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
|
||||||
|
|
|
@ -1488,12 +1488,12 @@ impl Child {
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// ::std::process::exit(match run_app() {
|
/// std::process::exit(match run_app() {
|
||||||
/// Ok(_) => 0,
|
/// Ok(_) => 0,
|
||||||
/// Err(err) => {
|
/// Err(err) => {
|
||||||
/// eprintln!("error: {:?}", err);
|
/// eprintln!("error: {:?}", err);
|
||||||
/// 1
|
/// 1
|
||||||
/// }
|
/// }
|
||||||
/// });
|
/// });
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue