mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Remove leading :: from paths in doc examples
This commit is contained in:
parent
857a55b8f0
commit
040d88dda1
@ -167,7 +167,7 @@ pub trait FromIterator<A>: Sized {
|
||||
/// // and we'll implement IntoIterator
|
||||
/// impl IntoIterator for MyCollection {
|
||||
/// type Item = i32;
|
||||
/// type IntoIter = ::std::vec::IntoIter<Self::Item>;
|
||||
/// type IntoIter = std::vec::IntoIter<Self::Item>;
|
||||
///
|
||||
/// fn into_iter(self) -> Self::IntoIter {
|
||||
/// 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)]
|
||||
/// # 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>
|
||||
/// where
|
||||
/// 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) {
|
||||
/// loop {
|
||||
/// match ::std::str::from_utf8(input) {
|
||||
/// match std::str::from_utf8(input) {
|
||||
/// Ok(valid) => {
|
||||
/// push(valid);
|
||||
/// break
|
||||
@ -184,7 +184,7 @@ Section: Creating a string
|
||||
/// Err(error) => {
|
||||
/// let (valid, after_valid) = input.split_at(error.valid_up_to());
|
||||
/// unsafe {
|
||||
/// push(::std::str::from_utf8_unchecked(valid))
|
||||
/// push(std::str::from_utf8_unchecked(valid))
|
||||
/// }
|
||||
/// push("\u{FFFD}");
|
||||
///
|
||||
|
@ -202,7 +202,7 @@ impl UdpSocket {
|
||||
///
|
||||
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
|
||||
/// 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")]
|
||||
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
|
||||
|
@ -1488,12 +1488,12 @@ impl Child {
|
||||
/// }
|
||||
///
|
||||
/// fn main() {
|
||||
/// ::std::process::exit(match run_app() {
|
||||
/// Ok(_) => 0,
|
||||
/// Err(err) => {
|
||||
/// eprintln!("error: {:?}", err);
|
||||
/// 1
|
||||
/// }
|
||||
/// std::process::exit(match run_app() {
|
||||
/// Ok(_) => 0,
|
||||
/// Err(err) => {
|
||||
/// eprintln!("error: {:?}", err);
|
||||
/// 1
|
||||
/// }
|
||||
/// });
|
||||
/// }
|
||||
/// ```
|
||||
|
Loading…
Reference in New Issue
Block a user