History

thanks clippy

Sebastian Thiel committed 5 years ago

Commit 6200ed91 parent 217451320 files · +52 −50Browse files

Showing the changes to git-object/src (2 of 20 files). Show all

Unified · Split

2 files
  1. git-object/src/mutable/tag.rs +1 −1
  2. git-object/src/types.rs +2 −2
git-object/src/mutable/tag.rs+1−1
@@ -46,7 +46,7 @@ impl Tag { · 45 unmodified lines
4646 /// Writes the encoded tag to `out`.
4747 pub fn write_to(&self, mut out: impl io::Write) -> io::Result<()> {
4848 encode::trusted_header_id(b"object", &self.target, &mut out)?;
49− encode::trusted_header_field(b"type", self.target_kind.to_bytes(), &mut out)?;
49+ encode::trusted_header_field(b"type", self.target_kind.as_bytes(), &mut out)?;
5050 encode::header_field(b"tag", validated_name(self.name.as_ref())?, &mut out)?;
5151 if let Some(tagger) = &self.signature {
5252 encode::trusted_header_signature(b"tagger", tagger, &mut out)?;
git-object/src/types.rs+2−2
@@ -87,7 +87,7 @@ impl Kind { · 86 unmodified lines
8787 }
8888
8989 /// Return the name of `self` for use in serialized loose git objects.
90− pub fn to_bytes(&self) -> &[u8] {
90+ pub fn as_bytes(&self) -> &[u8] {
9191 match self {
9292 Kind::Tree => b"tree",
9393 Kind::Commit => b"commit",
@@ -99,7 +99,7 @@ impl Kind { · 5 unmodified lines
9999
100100 impl fmt::Display for Kind {
101101 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
102− f.write_str(std::str::from_utf8(self.to_bytes()).expect("Converting Kind name to utf8"))
102+ f.write_str(std::str::from_utf8(self.as_bytes()).expect("Converting Kind name to utf8"))
103103 }
104104 }
105105