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