mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-16 08:10:41 +08:00
git-ref-format: rename namespace functions
The namespace functions can read confusingly: * `namespaced` - the naming sounds like it is namespacing the input, when in fact it is ensuring that the input is namespaced. * `add_namespace` - can be read as adding the namespace to the end of a ref, when in fact it is placed at the beginning. Change the naming, respectively, to: * `to_namespaced` - this uses the conversion naming convention detailed here[0]. * `with_namespace` - reads as plainly namespacing the ref string. [0]: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
This commit is contained in:
@@ -103,7 +103,7 @@ impl<'de: 'a, 'a> Decode<'de> for Namespaced<'a> {
|
||||
#[inline]
|
||||
fn decode(d: &mut Decoder<'de>) -> Result<Self, decode::Error> {
|
||||
Decode::decode(d).and_then(|s: &RefStr| {
|
||||
s.namespaced()
|
||||
s.to_namespaced()
|
||||
.ok_or(decode::Error::Message("not a namespaced ref"))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user