Skip to content

Commit cc640f6

Browse files
committed
Define fmt only on ToolchainSpec
1 parent 6e4dbe9 commit cc640f6

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/toolchains.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,7 @@ pub(crate) struct Toolchain {
6969

7070
impl fmt::Display for Toolchain {
7171
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
72-
match self.spec {
73-
ToolchainSpec::Ci { ref commit, alt } => {
74-
let alt_s = if alt {
75-
"-alt".to_string()
76-
} else {
77-
String::new()
78-
};
79-
write!(f, "{}{}", commit, alt_s)
80-
}
81-
ToolchainSpec::Nightly { ref date } => write!(f, "nightly-{}", date.format(YYYY_MM_DD)),
82-
}
72+
write!(f, "{}", self.spec)
8373
}
8474
}
8575

@@ -407,7 +397,7 @@ impl fmt::Display for ToolchainSpec {
407397
};
408398
write!(f, "{}{}", commit, alt_s)
409399
}
410-
ToolchainSpec::Nightly { ref date } => write!(f, "nightly-{}", date),
400+
ToolchainSpec::Nightly { ref date } => write!(f, "nightly-{}", date.format(YYYY_MM_DD)),
411401
}
412402
}
413403
}

0 commit comments

Comments
 (0)