From 562042312d63ce537887e3023dd08cc207d84e8c Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 12 Feb 2023 12:10:18 -0800 Subject: [PATCH] templater: inline trivial `CommitOrChangeId::as_bytes()` --- src/templater.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/templater.rs b/src/templater.rs index cf7574b5f..272609f0f 100644 --- a/src/templater.rs +++ b/src/templater.rs @@ -553,10 +553,6 @@ impl<'a> CommitOrChangeId<'a> { } } - pub fn as_bytes(&self) -> &[u8] { - &self.id_bytes - } - pub fn hex(&self) -> String { hex::encode(&self.id_bytes) } @@ -578,7 +574,7 @@ impl<'a> CommitOrChangeId<'a> { // TODO: maybe split commit_id/change_id spaces and remove min(hex.len())? let mut hex = self.hex(); let prefix_len = min( - self.repo.shortest_unique_id_prefix_len(self.as_bytes()), + self.repo.shortest_unique_id_prefix_len(&self.id_bytes), hex.len(), ); hex.truncate(max(prefix_len, total_len));