Apply review comments

This commit is contained in:
Jakub Beránek 2025-07-02 12:18:56 +02:00
parent e6c64df274
commit 3f3c498137
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
2 changed files with 3 additions and 2 deletions

View file

@ -186,6 +186,8 @@ impl StepMetadata {
pub fn get_stage(&self) -> Option<u32> {
self.stage.or(self
.built_by
// For std, its stage corresponds to the stage of the compiler that builds it.
// For everything else, a stage N things gets built by a stage N-1 compiler.
.map(|compiler| if self.name == "std" { compiler.stage } else { compiler.stage + 1 }))
}
}

View file

@ -1667,8 +1667,7 @@ fn render_metadata(metadata: &StepMetadata) -> String {
if let Some(compiler) = metadata.built_by {
write!(record, "{} -> ", render_compiler(compiler));
}
let stage =
if let Some(stage) = metadata.get_stage() { format!("{stage} ") } else { "".to_string() };
let stage = metadata.get_stage().map(|stage| format!("{stage} ")).unwrap_or_default();
write!(record, "{} {stage}<{}>", metadata.name, normalize_target(metadata.target));
record
}