We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6474be0 + c51b68d commit 71f245aCopy full SHA for 71f245a
src/main.rs
@@ -248,13 +248,14 @@ impl CommitInfo {
248
249
impl fmt::Display for CommitInfo {
250
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
251
+ let short_commit = self.commit.to_string().chars().take(7).collect::<String>();
252
if self.refs.len() > 0 {
253
let refs_str = self.refs.iter().map(|ref_name| {
254
ref_name.as_str()
255
}).collect::<Vec<&str>>().join(", ");
- write!(f, "{} ({})", self.commit, refs_str)
256
+ write!(f, "{} ({})", short_commit, refs_str)
257
} else {
- write!(f, "{}", self.commit)
258
+ write!(f, "{}", short_commit)
259
}
260
261
0 commit comments