History

thanks clippy

Sebastian Thiel committed 5 years ago

Commit 321908e1 parent 1dcc5903 files · +5 −5Browse files

Unified · Split

3 files
  1. git-ref/src/name.rs +2 −2
  2. git-ref/src/store/file/transaction.rs +2 −2
  3. git-ref/src/store/packed/decode.rs +1 −1
git-ref/src/name.rs+2−2
@@ -30,7 +30,7 @@ use std::convert::Infallible; · 29 unmodified lines
3030
3131 impl<'a> FullName<'a> {
3232 /// Convert this name into the relative path identifying the reference location.
33− pub fn to_path(&self) -> Cow<'a, Path> {
33+ pub fn to_path(self) -> Cow<'a, Path> {
3434 self.0.to_path_lossy()
3535 }
3636
@@ -43,7 +43,7 @@ impl<'a> FullName<'a> { · 6 unmodified lines
4343 impl<'a> PartialName<'a> {
4444 /// Convert this name into the relative path possibly identifying the reference location.
4545 /// Note that it may be only a partial path though.
46− pub fn to_partial_path(&self) -> Cow<'a, Path> {
46+ pub fn to_partial_path(self) -> Cow<'a, Path> {
4747 self.0.to_path_lossy()
4848 }
4949
git-ref/src/store/file/transaction.rs+2−2
@@ -102,7 +102,7 @@ impl<'a> Transaction<'a> { · 101 unmodified lines
102102
103103 // Keep the previous value for the caller and ourselves. Maybe they want to keep a log of sorts.
104104 if let Some(existing) = existing_ref {
105− *previous = Some(existing.target.into());
105+ *previous = Some(existing.target);
106106 }
107107
108108 lock
@@ -165,7 +165,7 @@ impl<'a> Transaction<'a> { · 56 unmodified lines
165165 *previous = match existing_ref {
166166 None => Create::Only,
167167 Some(existing) => Create::OrUpdate {
168− previous: Some(existing.target.into()),
168+ previous: Some(existing.target),
169169 },
170170 };
171171
git-ref/src/store/packed/decode.rs+1−1
@@ -73,7 +73,7 @@ pub fn reference<'a, E: ParseError<&'a [u8]> + FromExternalError<&'a [u8], crate · 72 unmodified lines
7373 ) -> IResult<&'a [u8], packed::Reference<'a>, E> {
7474 let (input, (target, name)) = tuple((
7575 terminated(hex_hash, tag(b" ")),
76− map_res(until_newline, |name| crate::FullName::try_from(name)),
76+ map_res(until_newline, crate::FullName::try_from),
7777 ))(input)?;
7878 let (rest, object) = opt(delimited(tag(b"^"), hex_hash, newline))(input)?;
7979 Ok((rest, packed::Reference { name, target, object }))