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:
Fintan Halpenny
2022-10-13 09:21:53 +01:00
parent 8d65feb80d
commit daffac4101
5 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ impl RefStr {
}
#[inline]
pub fn namespaced(&self) -> Option<Namespaced> {
pub fn to_namespaced(&self) -> Option<Namespaced> {
self.into()
}