Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,15 +1237,15 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// Path::new("foo.txt");
/// ```
///
/// You can create `Path`s from `String`s, or even other `Path`s:
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let string = String::from("foo.txt");
/// let from_string = Path::new(&string);
Expand All @@ -1262,7 +1262,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let os_str = Path::new("foo.txt").as_os_str();
/// assert_eq!(os_str, std::ffi::OsStr::new("foo.txt"));
Expand All @@ -1279,7 +1279,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path_str = Path::new("foo.txt").to_str();
//// assert_eq!(path_str, Some("foo.txt"));
Expand All @@ -1296,7 +1296,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path_str = Path::new("foo.txt").to_string_lossy();
/// assert_eq!(path_str, "foo.txt");
Expand All @@ -1311,7 +1311,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path_buf = Path::new("foo.txt").to_path_buf();
/// assert_eq!(path_buf, std::path::PathBuf::from("foo.txt"));
Expand All @@ -1333,7 +1333,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// assert!(!Path::new("foo.txt").is_absolute());
/// ```
Expand All @@ -1348,7 +1348,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// assert!(Path::new("foo.txt").is_relative());
/// ```
Expand Down Expand Up @@ -1379,7 +1379,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// assert!(Path::new("/etc/passwd").has_root());
/// ```
Expand All @@ -1395,7 +1395,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path = Path::new("/foo/bar");
/// let parent = path.parent().unwrap();
Expand Down Expand Up @@ -1425,7 +1425,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
/// use std::ffi::OsStr;
///
/// let path = Path::new("foo.txt");
Expand Down Expand Up @@ -1458,7 +1458,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path = Path::new("/etc/passwd");
///
Expand All @@ -1478,7 +1478,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path = Path::new("/etc/passwd");
///
Expand All @@ -1501,7 +1501,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path = Path::new("foo.rs");
///
Expand All @@ -1524,7 +1524,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path = Path::new("foo.rs");
///
Expand All @@ -1542,7 +1542,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::{Path, PathBuf};
/// # use std::path::{Path, PathBuf};
///
/// assert_eq!(Path::new("/etc").join("passwd"), PathBuf::from("/etc/passwd"));
/// ```
Expand All @@ -1560,7 +1560,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::{Path, PathBuf};
/// # use std::path::{Path, PathBuf};
///
/// let path = Path::new("/tmp/foo.txt");
/// assert_eq!(path.with_file_name("bar.txt"), PathBuf::from("/tmp/bar.txt"));
Expand All @@ -1579,7 +1579,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::{Path, PathBuf};
/// # use std::path::{Path, PathBuf};
///
/// let path = Path::new("foo.rs");
/// assert_eq!(path.with_extension("txt"), PathBuf::from("foo.txt"));
Expand All @@ -1596,7 +1596,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::{Path, Component};
/// # use std::path::{Path, Component};
/// use std::ffi::OsStr;
///
/// let mut components = Path::new("/tmp/foo.txt").components();
Expand All @@ -1623,7 +1623,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::{self, Path};
/// # use std::path::{self, Path};
/// use std::ffi::OsStr;
///
/// let mut it = Path::new("/tmp/foo.txt").iter();
Expand All @@ -1643,7 +1643,7 @@ impl Path {
/// # Examples
///
/// ```
/// use std::path::Path;
/// # use std::path::Path;
///
/// let path = Path::new("/tmp/foo.rs");
///
Expand Down