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
30 30
31impl<'a> FullName<'a> {31impl<'a> FullName<'a> {
32 /// Convert this name into the relative path identifying the reference location.32 /// 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> {
34 self.0.to_path_lossy()34 self.0.to_path_lossy()
35 }35 }
36 36
@@ -43,7 +43,7 @@ impl<'a> FullName<'a> { · 6 unmodified lines
43impl<'a> PartialName<'a> {43impl<'a> PartialName<'a> {
44 /// Convert this name into the relative path possibly identifying the reference location.44 /// Convert this name into the relative path possibly identifying the reference location.
45 /// Note that it may be only a partial path though.45 /// 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> {
47 self.0.to_path_lossy()47 self.0.to_path_lossy()
48 }48 }
49 49
git-ref/src/store/file/transaction.rs+2−2
@@ -102,7 +102,7 @@ impl<'a> Transaction<'a> { · 101 unmodified lines
102 102
103 // Keep the previous value for the caller and ourselves. Maybe they want to keep a log of sorts.103 // Keep the previous value for the caller and ourselves. Maybe they want to keep a log of sorts.
104 if let Some(existing) = existing_ref {104 if let Some(existing) = existing_ref {
105 *previous = Some(existing.target.into());105 *previous = Some(existing.target);
106 }106 }
107 107
108 lock108 lock
@@ -165,7 +165,7 @@ impl<'a> Transaction<'a> { · 56 unmodified lines
165 *previous = match existing_ref {165 *previous = match existing_ref {
166 None => Create::Only,166 None => Create::Only,
167 Some(existing) => Create::OrUpdate {167 Some(existing) => Create::OrUpdate {
168 previous: Some(existing.target.into()),168 previous: Some(existing.target),
169 },169 },
170 };170 };
171 171
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
73) -> IResult<&'a [u8], packed::Reference<'a>, E> {73) -> IResult<&'a [u8], packed::Reference<'a>, E> {
74 let (input, (target, name)) = tuple((74 let (input, (target, name)) = tuple((
75 terminated(hex_hash, tag(b" ")),75 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),
77 ))(input)?;77 ))(input)?;
78 let (rest, object) = opt(delimited(tag(b"^"), hex_hash, newline))(input)?;78 let (rest, object) = opt(delimited(tag(b"^"), hex_hash, newline))(input)?;
79 Ok((rest, packed::Reference { name, target, object }))79 Ok((rest, packed::Reference { name, target, object }))