fixing some unused imports
This commit is contained in:
parent
ed9693c27b
commit
7bdd8225cb
4 changed files with 48 additions and 8 deletions
|
|
@ -1,8 +1,8 @@
|
|||
// use dirs;
|
||||
use std::{fs::read_to_string, path::PathBuf};
|
||||
use tracing::{debug, debug_span, error, info, instrument};
|
||||
use std::{fs::read_to_string, path::Path};
|
||||
use tracing::debug;
|
||||
|
||||
pub fn count_slides_and_fragments(html_file_path: PathBuf) -> i32 {
|
||||
pub fn count_slides_and_fragments(html_file_path: &Path) -> i32 {
|
||||
debug!(path = ?html_file_path, "Starting slide counter");
|
||||
// Read the HTML file
|
||||
let html_content = read_to_string(html_file_path)
|
||||
|
|
@ -31,3 +31,15 @@ pub fn count_slides_and_fragments(html_file_path: PathBuf) -> i32 {
|
|||
|
||||
total as i32
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::path::Path;
|
||||
|
||||
#[test]
|
||||
fn count_slides_test() {
|
||||
let html_file = Path::new("/home/chris/org/lessons/2023_24_1_adam_and_eve_lesson.html");
|
||||
assert_eq!(count_slides_and_fragments(html_file), 33);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue