1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-16 19:14:20 +02:00

Update to Rust 2024 edition. (#2658)

This commit is contained in:
Andrew Walbran
2025-05-23 19:03:03 +01:00
committed by GitHub
parent db47709e87
commit fc6e5c7526
83 changed files with 150 additions and 149 deletions

View File

@ -2,7 +2,7 @@
name = "mdbook-course"
version = "0.1.0"
authors = ["Dustin Mitchell <djmitche@google.com>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
publish = false
repository = "https://github.com/google/comprehensive-rust"

View File

@ -35,8 +35,8 @@
//! item becomes the first slide in that segment. Any other sub-items of the
//! top-level item are treated as further slides in the same segment.
use crate::frontmatter::{split_frontmatter, Frontmatter};
use crate::markdown::{duration, Table};
use crate::frontmatter::{Frontmatter, split_frontmatter};
use crate::markdown::{Table, duration};
use mdbook::book::{Book, BookItem, Chapter};
use std::fmt::Write;
use std::path::PathBuf;
@ -318,7 +318,9 @@ impl Session {
}
format!(
"Including {BREAK_DURATION} minute breaks, this session should take about {}. It contains:\n\n{}",
duration(self.minutes()), segments)
duration(self.minutes()),
segments
)
}
/// Return the total duration of this session.
@ -337,11 +339,7 @@ impl Session {
///
/// This includes breaks between segments.
pub fn target_minutes(&self) -> u64 {
if self.target_minutes > 0 {
self.target_minutes
} else {
self.minutes()
}
if self.target_minutes > 0 { self.target_minutes } else { self.minutes() }
}
}