Skip to content

Commit b8f996a

Browse files
committed
fix(log): make RunId format simpler
1 parent 3600c73 commit b8f996a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cargo/util/logger.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub struct RunId {
108108
}
109109

110110
impl RunId {
111-
const FORMAT: &str = "%Y-%m-%dT%H%M%S%3fZ";
111+
const FORMAT: &str = "%Y%m%dT%H%M%S%3fZ";
112112

113113
pub fn new<H: Hash>(h: &H) -> RunId {
114114
RunId {
@@ -140,7 +140,7 @@ impl std::str::FromStr for RunId {
140140

141141
fn from_str(s: &str) -> Result<Self, Self::Err> {
142142
let msg =
143-
|| format!("expect run ID in format `2006-07-24T012128000Z-<16-char-hex>`, got `{s}`");
143+
|| format!("expect run ID in format `20060724T012128000Z-<16-char-hex>`, got `{s}`");
144144
let Some((timestamp, hash)) = s.rsplit_once('-') else {
145145
anyhow::bail!(msg());
146146
};
@@ -166,7 +166,7 @@ mod tests {
166166

167167
#[test]
168168
fn run_id_round_trip() {
169-
let id = "2006-07-24T012128000Z-b0fd440798ab3cfb";
169+
let id = "20060724T012128000Z-b0fd440798ab3cfb";
170170
assert_eq!(id, &id.parse::<RunId>().unwrap().to_string());
171171
}
172172
}

0 commit comments

Comments
 (0)