Skip to content

Commit 8e8c71b

Browse files
committed
fix: implement Clone for PartialName.
Also improve documentation for `FullName*` and `PartialName*` types.
1 parent 0eecfab commit 8e8c71b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

gix-ref/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,28 +104,27 @@ pub(crate) struct Store {
104104
inner: store::State,
105105
}
106106

107-
/// Indicate that the given BString is a validate reference name or path that can be used as path on disk or written as target
108-
/// of a symbolic reference
107+
/// A validated complete and fully qualified referenced reference name, safe to use for all operations.
109108
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
110109
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
111110
pub struct FullName(pub(crate) BString);
112111

113-
/// A validated and potentially partial reference name - it can safely be used for common operations.
112+
/// A validated complete and fully qualified referenced reference name, safe to use for all operations.
114113
#[derive(Hash, Debug, PartialEq, Eq, Ord, PartialOrd)]
115114
#[repr(transparent)]
116115
pub struct FullNameRef(BStr);
117116

118-
/// A validated complete and fully qualified reference name, safe to use for all operations.
117+
/// A validated and potentially partial reference name, safe to use for common operations.
119118
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
120119
pub struct PartialNameCow<'a>(Cow<'a, BStr>);
121120

122-
/// A validated complete and fully qualified referenced reference name, safe to use for all operations.
121+
/// A validated and potentially partial reference name, safe to use for common operations.
123122
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]
124123
#[repr(transparent)]
125124
pub struct PartialNameRef(BStr);
126125

127-
/// A validated complete and fully qualified owned reference name, safe to use for all operations.
128-
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]
126+
/// A validated and potentially partial reference name, safe to use for common operations.
127+
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
129128
pub struct PartialName(BString);
130129

131130
/// A _validated_ prefix for references to act as a namespace.

0 commit comments

Comments
 (0)