History

feat: `CommitRef::message_trailers()` as shortcut… (#198)

…which also saves parsing time.

Sebastian Thiel committed 5 years ago

Commit 53243911 parent c3b01614 files · +36 −12Browse files

Showing the changes to git-object/src/commit/mod.rs (1 of 4 files). Show all

Unified · Split

git-object/src/commit/mod.rs+0−7
@@ -1,5 +1,3 @@
1use std::borrow::Cow;
2
3use bstr::{BStr, ByteSlice};1use bstr::{BStr, ByteSlice};
4 2
5use crate::{Commit, CommitRef, TagRef};3use crate::{Commit, CommitRef, TagRef};
@@ -54,11 +52,6 @@ impl<'a> CommitRef<'a> { · 48 unmodified lines
54 pub fn message(&self) -> MessageRef<'a> {52 pub fn message(&self) -> MessageRef<'a> {
55 MessageRef::from_bytes(self.message)53 MessageRef::from_bytes(self.message)
56 }54 }
57
58 /// Return exactly the same message as [`MessageRef::summary()`].
59 pub fn summary(&self) -> Cow<'a, BStr> {
60 message::summary(self.message)
61 }
62}55}
63 56
64impl Commit {57impl Commit {