You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-17 19:37:48 +02:00
Handle a missing "Fundamentals" course (#1509)
We need to work with translations which haven't yet been updated to use frontmatter.
This commit is contained in:
@ -87,7 +87,9 @@ fn preprocess() -> anyhow::Result<()> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Print a summary of times for the "Fundamentals" course.
|
// Print a summary of times for the "Fundamentals" course.
|
||||||
let fundamentals = courses.find_course("Fundamentals").unwrap();
|
// Translations with a POT-Creation-Date before 2023-11-29 (when
|
||||||
|
// we merged #1073) will have no frontmatter.
|
||||||
|
if let Some(fundamentals) = courses.find_course("Fundamentals") {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Fundamentals: {}",
|
"Fundamentals: {}",
|
||||||
timediff(fundamentals.minutes(), 8 * 3 * 60)
|
timediff(fundamentals.minutes(), 8 * 3 * 60)
|
||||||
@ -104,6 +106,7 @@ fn preprocess() -> anyhow::Result<()> {
|
|||||||
eprintln!(" {}: {}", segment.name, duration(segment.minutes()));
|
eprintln!(" {}: {}", segment.name, duration(segment.minutes()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
serde_json::to_writer(stdout(), &book)?;
|
serde_json::to_writer(stdout(), &book)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Reference in New Issue
Block a user