Skip to content

Commit 1f0e643

Browse files
committed
📝 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.
1 parent 07045d5 commit 1f0e643

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

lib/src/entry/builder.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ impl EntryBuilder {
167167
}
168168
}
169169

170-
/// Creates a new directory with the given name.
170+
/// Creates a new [`EntryBuilder`] for a directory entry.
171171
#[inline]
172172
pub const fn new_dir(name: EntryName) -> Self {
173173
Self::new(EntryHeader::for_dir(name))
174174
}
175175

176-
/// Creates a new file with the given name and write options.
176+
/// Creates a new [`EntryBuilder`] for a file entry with the given write options.
177177
///
178178
/// # Errors
179179
///
@@ -218,7 +218,7 @@ impl EntryBuilder {
218218
})
219219
}
220220

221-
/// Creates a new symbolic link with the given name and link.
221+
/// Creates a new [`EntryBuilder`] for a symbolic link entry pointing to the given source.
222222
///
223223
/// # Errors
224224
///
@@ -229,8 +229,8 @@ impl EntryBuilder {
229229
/// use libpna::{EntryBuilder, EntryName, EntryReference};
230230
///
231231
/// let builder = EntryBuilder::new_symlink(
232-
/// EntryName::try_from("path/of/target").unwrap(),
233-
/// EntryReference::try_from("path/of/source").unwrap(),
232+
/// EntryName::try_from("path/of/link").unwrap(),
233+
/// EntryReference::try_from("path/of/target").unwrap(),
234234
/// )
235235
/// .unwrap();
236236
/// let entry = builder.build().unwrap();
@@ -240,7 +240,7 @@ impl EntryBuilder {
240240
Self::new_link(EntryHeader::for_symlink(name), source)
241241
}
242242

243-
/// Creates a new hard link with the given name and link.
243+
/// Creates a new [`EntryBuilder`] for a hard link entry pointing to the given source.
244244
///
245245
/// # Errors
246246
///
@@ -251,8 +251,8 @@ impl EntryBuilder {
251251
/// use libpna::{EntryBuilder, EntryName, EntryReference};
252252
///
253253
/// let builder = EntryBuilder::new_hard_link(
254-
/// EntryName::try_from("path/of/target").unwrap(),
255-
/// EntryReference::try_from("path/of/source").unwrap(),
254+
/// EntryName::try_from("path/of/link").unwrap(),
255+
/// EntryReference::try_from("path/of/target").unwrap(),
256256
/// )
257257
/// .unwrap();
258258
/// let entry = builder.build().unwrap();

0 commit comments

Comments
 (0)