Skip to content

Commit 136a16b

Browse files
committed
Fix documentation bug about absolute paths (fixes #44)
1 parent e7d78fa commit 136a16b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

relative-path/src/lib.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -702,18 +702,22 @@ impl RelativePathBuf {
702702

703703
/// Extends `self` with `path`.
704704
///
705-
/// If `path` is absolute, it replaces the current path.
706-
///
707705
/// # Examples
708706
///
709707
/// ```
710-
/// use relative_path::{RelativePathBuf, RelativePath};
708+
/// use relative_path::RelativePathBuf;
711709
///
712710
/// let mut path = RelativePathBuf::new();
713711
/// path.push("foo");
714712
/// path.push("bar");
715713
///
716714
/// assert_eq!("foo/bar", path);
715+
///
716+
/// let mut path = RelativePathBuf::new();
717+
/// path.push("foo");
718+
/// path.push("/bar");
719+
///
720+
/// assert_eq!("foo/bar", path);
717721
/// ```
718722
pub fn push<P>(&mut self, path: P)
719723
where

0 commit comments

Comments
 (0)