Skip to content

Commit

Permalink
fix: some clippy warnings and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKreil committed Jan 23, 2025
1 parent 91a9f81 commit d988107
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ lazy_static = { version = "1.5.0", default-features = false }
log = { version = "0.4.25", default-features = false }
num_cpus = { version = "1.16.0", default-features = false }
regex = { version = "1.11.1", default-features = false, features = [
"std",
"unicode-case",
"unicode-perl",
] }
Expand Down
1 change: 1 addition & 0 deletions versatiles_container/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ assert_fs.workspace = true
wildmatch.workspace = true

versatiles.workspace = true
versatiles_core = { workspace = true, features = ["test"] }

[features]
default = []
Expand Down
3 changes: 2 additions & 1 deletion versatiles_container/src/container/versatiles/reader.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

//! Module for reading `versatiles` tile containers.
//!
//! This module provides the `VersaTilesReader` struct, which implements the `TilesReader` trait for reading tile data from a `versatiles` container. It supports reading metadata, tile data, and probing the container for debugging purposes.
Expand Down Expand Up @@ -63,7 +65,6 @@ pub struct VersaTilesReader {
tilejson: TileJSON,
}

#[allow(dead_code)]
impl VersaTilesReader {
/// Opens a `versatiles` container from a file path.
///
Expand Down
8 changes: 1 addition & 7 deletions versatiles_core/src/utils/pretty_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ impl PrettyPrint {
pub async fn as_string(&self) -> String {
self.printer.as_string().await
}

#[allow(dead_code)]
pub async fn add_str(&self, text: String) {
self.printer.write(text).await;
}
}

impl Default for PrettyPrint {
Expand Down Expand Up @@ -160,14 +155,13 @@ mod tests {
printer.add_warning("test_warning_1").await;
let mut cat = printer.get_category("test_category_1").await;
cat.get_list("test_list_1").await.add_key_value("string_1", &4).await;
cat.add_str(String::from("string_2")).await;
cat.add_warning("test_warning_2").await;
printer.add_warning("test_warning_3").await;

let result = printer.as_string().await;
assert_eq!(
&result,
"test_warning_1\ntest_category_1:\n test_list_1:\n string_1: 4\nstring_2 test_warning_2\ntest_warning_3\n"
"test_warning_1\ntest_category_1:\n test_list_1:\n string_1: 4\n test_warning_2\ntest_warning_3\n"
);
}

Expand Down

0 comments on commit d988107

Please sign in to comment.