feat: optimize imports to remove warnings

This commit is contained in:
alphafetus committed 2026-01-05 15:56:28 -05:00
1 parent 9c7b7f1d4f
commit a2f69a83c2
16 files changed
+46 -109

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ pub struct ComparisonData {
}
impl ComparisonData {
#[allow(unused)]
pub fn new(
id: impl Into<String>,
member: impl Into<String>,
-1
View File
@@ -3,7 +3,6 @@ mod lists;
mod number;
mod text;
mod traits;
mod utils;
pub use self::{base::*, lists::*, number::*, text::*, traits::*};
-28
View File
@@ -1,28 +0,0 @@
use crate::common::ValueType;
/// This function is a work in progress. It's designed to flatten a list of maps by using the
/// given key and verifier function, however it currently doesn't work and just needs to be
/// planned out a little more.
fn flatten_map_helper<F>(
list: &Vec<ValueType>,
key: &String,
verifier: F,
) -> Result<Vec<ValueType>, String>
where
F: Fn(&ValueType) -> Option<&ValueType>,
{
let mut out = Vec::new();
for item in list {
let map = match item {
ValueType::Map(Some(map)) => map,
_ => return Err("Expected a map".to_owned()),
};
// Get the key, and verify that the value is the correct type. If so, push it.
if let Some(value) = map.get(key).and_then(|v| verifier(v)) {
out.push(value.clone());
}
}
Ok(out)
}