From 528d4372b57a9dd1df0dadb7589ec3d802d238ca Mon Sep 17 00:00:00 2001 From: ChanTsune <41658782+ChanTsune@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:23:30 +0900 Subject: [PATCH] :memo: Fix inaccurate EntryBuilder factory method summaries Also fix misleading path strings in symlink/hard link examples where "path/of/target" was used for the link name and "path/of/source" for the link target, reversing the actual semantics. --- lib/src/entry/builder.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/entry/builder.rs b/lib/src/entry/builder.rs index d32e70f78..82a8a6da9 100644 --- a/lib/src/entry/builder.rs +++ b/lib/src/entry/builder.rs @@ -167,13 +167,13 @@ impl EntryBuilder { } } - /// Creates a new directory with the given name. + /// Creates a new [`EntryBuilder`] for a directory entry. #[inline] pub const fn new_dir(name: EntryName) -> Self { Self::new(EntryHeader::for_dir(name)) } - /// Creates a new file with the given name and write options. + /// Creates a new [`EntryBuilder`] for a file entry with the given write options. /// /// # Errors /// @@ -218,7 +218,7 @@ impl EntryBuilder { }) } - /// Creates a new symbolic link with the given name and link. + /// Creates a new [`EntryBuilder`] for a symbolic link entry pointing to the given source. /// /// # Errors /// @@ -229,8 +229,8 @@ impl EntryBuilder { /// use libpna::{EntryBuilder, EntryName, EntryReference}; /// /// let builder = EntryBuilder::new_symlink( - /// EntryName::try_from("path/of/target").unwrap(), - /// EntryReference::try_from("path/of/source").unwrap(), + /// EntryName::try_from("path/of/link").unwrap(), + /// EntryReference::try_from("path/of/target").unwrap(), /// ) /// .unwrap(); /// let entry = builder.build().unwrap(); @@ -240,7 +240,7 @@ impl EntryBuilder { Self::new_link(EntryHeader::for_symlink(name), source) } - /// Creates a new hard link with the given name and link. + /// Creates a new [`EntryBuilder`] for a hard link entry pointing to the given source. /// /// # Errors /// @@ -251,8 +251,8 @@ impl EntryBuilder { /// use libpna::{EntryBuilder, EntryName, EntryReference}; /// /// let builder = EntryBuilder::new_hard_link( - /// EntryName::try_from("path/of/target").unwrap(), - /// EntryReference::try_from("path/of/source").unwrap(), + /// EntryName::try_from("path/of/link").unwrap(), + /// EntryReference::try_from("path/of/target").unwrap(), /// ) /// .unwrap(); /// let entry = builder.build().unwrap();