We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ccf8317 + cf3d6b5 commit b28f0b1Copy full SHA for b28f0b1
src/libstd/path.rs
@@ -632,9 +632,11 @@ impl<'a> Components<'a> {
632
/// ```
633
/// use std::path::Path;
634
///
635
- /// let path = Path::new("/tmp/foo/bar.txt");
+ /// let mut components = Path::new("/tmp/foo/bar.txt").components();
636
+ /// components.next();
637
638
- /// println!("{:?}", path.components().as_path());
639
+ /// assert_eq!(Path::new("foo/bar.txt"), components.as_path());
640
641
#[stable(feature = "rust1", since = "1.0.0")]
642
pub fn as_path(&self) -> &'a Path {
0 commit comments