Skip to content

Commit 863549b

Browse files
committed
Thanks clippy
1 parent 20150e1 commit 863549b

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

gix-path/src/relative_path.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use bstr::BString;
33
use bstr::ByteSlice;
44
use gix_validate::path::component::Options;
55
use std::borrow::Cow;
6-
use std::u8;
76

87
use crate::os_str_into_bstr;
98
use crate::try_from_bstr;
@@ -67,7 +66,7 @@ impl<'a, const N: usize> TryFrom<&'a [u8; N]> for &'a RelativePath {
6766

6867
#[inline]
6968
fn try_from(value: &'a [u8; N]) -> Result<Self, Self::Error> {
70-
let path: &std::path::Path = &try_from_byte_slice(value)?;
69+
let path: &std::path::Path = try_from_byte_slice(value)?;
7170

7271
let options: Options = Default::default();
7372

gix-ref/src/namespace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Namespace {
2222
///
2323
/// The prefix is a relative path with slash-separated path components.
2424
// TODO: use `RelativePath` type instead (see #1921), or a trait that helps convert into it.
25-
pub fn into_namespaced_prefix<'a>(mut self, prefix: &'a RelativePath) -> BString {
25+
pub fn into_namespaced_prefix(mut self, prefix: &RelativePath) -> BString {
2626
self.0.push_str(prefix);
2727
gix_path::to_unix_separators_on_windows(self.0).into_owned()
2828
}

gix-ref/src/store/file/loose/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl file::Store {
9090
///
9191
/// Prefixes are relative paths with slash-separated components.
9292
// TODO: use `RelativePath` type instead (see #1921), or a trait that helps convert into it.
93-
pub fn loose_iter_prefixed<'a>(&self, prefix: &'a RelativePath) -> std::io::Result<LooseThenPacked<'_, '_>> {
93+
pub fn loose_iter_prefixed(&self, prefix: &RelativePath) -> std::io::Result<LooseThenPacked<'_, '_>> {
9494
self.iter_prefixed_packed(prefix, None)
9595
}
9696
}

gix-ref/src/store/file/overlay_iter.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl Platform<'_> {
207207
///
208208
/// Prefixes are relative paths with slash-separated components.
209209
// TODO: use `RelativePath` type instead (see #1921), or a trait that helps convert into it.
210-
pub fn prefixed<'a>(&self, prefix: &'a RelativePath) -> std::io::Result<LooseThenPacked<'_, '_>> {
210+
pub fn prefixed(&self, prefix: &RelativePath) -> std::io::Result<LooseThenPacked<'_, '_>> {
211211
self.store
212212
.iter_prefixed_packed(prefix, self.packed.as_ref().map(|b| &***b))
213213
}
@@ -376,12 +376,11 @@ impl file::Store {
376376
///
377377
/// Prefixes are relative paths with slash-separated components.
378378
// TODO: use `RelativePath` type instead (see #1921), or a trait that helps convert into it.
379-
pub fn iter_prefixed_packed<'a, 's, 'p>(
379+
pub fn iter_prefixed_packed<'s, 'p>(
380380
&'s self,
381-
prefix: &'a RelativePath,
381+
prefix: &RelativePath,
382382
packed: Option<&'p packed::Buffer>,
383383
) -> std::io::Result<LooseThenPacked<'p, 's>> {
384-
let prefix = prefix.into();
385384
match self.namespace.as_ref() {
386385
None => {
387386
let git_dir_info = IterInfo::from_prefix(self.git_dir(), prefix, self.precompose_unicode)?;
@@ -393,7 +392,7 @@ impl file::Store {
393392
}
394393
Some(namespace) => {
395394
let prefix = namespace.to_owned().into_namespaced_prefix(prefix);
396-
let prefix = prefix.as_bstr().try_into().map_err(|err| std::io::Error::other(err))?;
395+
let prefix = prefix.as_bstr().try_into().map_err(std::io::Error::other)?;
397396
let git_dir_info = IterInfo::from_prefix(self.git_dir(), prefix, self.precompose_unicode)?;
398397
let common_dir_info = self
399398
.common_dir()

0 commit comments

Comments
 (0)