Skip to content

Commit 29c15a6

Browse files
committed
fix: only modify version src
1 parent e23c60e commit 29c15a6

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

version/src/lib.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,36 +79,22 @@ impl Default for Version {
7979

8080
impl fmt::Display for Version {
8181
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
82-
write!(
83-
f,
84-
"{}.{}.{}{} {:?}",
85-
self.major,
86-
self.minor,
87-
self.patch,
88-
if self.commit == Some(0) { "d" } else { "" },
89-
self
90-
)
82+
write!(f, "{}.{}.{}", self.major, self.minor, self.patch,)
9183
}
9284
}
9385

9486
impl fmt::Debug for Version {
9587
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9688
write!(
9789
f,
98-
"{}.{}.{}{} (src:{}; feat:{})",
90+
"{}.{}.{} (src:{}; feat:{})",
9991
self.major,
10092
self.minor,
10193
self.patch,
102-
if self.commit == Some(0) { "d" } else { "" },
10394
match self.commit {
10495
None => "devbuild".to_string(),
105-
Some(commit) => {
106-
if commit == 0 {
107-
"dbgbuild".to_string()
108-
} else {
109-
format!("{:08x}", commit)
110-
}
111-
}
96+
Some(commit) if commit == 0 => "dbgbuild".to_string(),
97+
Some(commit) => format!("{:08x}", commit),
11298
},
11399
self.feature_set,
114100
)

0 commit comments

Comments
 (0)