You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-11-06 09:29:26 +02:00
Add course and session markers for deep-dives (#1521)
This doesn't add any timing information. The authors of each deep-dive can do that separately. Fixes #1510.
This commit is contained in:
committed by
GitHub
parent
8862ab6530
commit
a73c830e45
@@ -321,6 +321,9 @@ impl Session {
|
||||
/// Return the total duration of this session.
|
||||
pub fn minutes(&self) -> u64 {
|
||||
let instructional_time: u64 = self.into_iter().map(|s| s.minutes()).sum();
|
||||
if instructional_time == 0 {
|
||||
return instructional_time;
|
||||
}
|
||||
let breaks = (self.into_iter().filter(|s| s.minutes() > 0).count() - 1) as u64
|
||||
* BREAK_DURATION;
|
||||
instructional_time + breaks
|
||||
|
||||
Reference in New Issue
Block a user