feat: optimize imports to remove warnings
This commit is contained in:
1 parent
9c7b7f1d4f
commit
a2f69a83c2
16 files changed
+46
-109
No files matched your search
@@ -23,6 +23,7 @@ pub struct ComparisonData {
|
||||
}
|
||||
|
||||
impl ComparisonData {
|
||||
#[allow(unused)]
|
||||
pub fn new(
|
||||
id: impl Into<String>,
|
||||
member: impl Into<String>,
|
||||
|
||||
@@ -3,7 +3,6 @@ mod lists;
|
||||
mod number;
|
||||
mod text;
|
||||
mod traits;
|
||||
mod utils;
|
||||
|
||||
pub use self::{base::*, lists::*, number::*, text::*, traits::*};
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -87,14 +87,6 @@ impl InputType {
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_view_rows(self, data_map: RwSignal<HashMap<String, ValueType>>) -> impl IntoView {
|
||||
view! {
|
||||
<Row>
|
||||
{self.into_view(data_map)}
|
||||
</Row>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Shorthand macro for creating `InputType` enums.
|
||||
|
||||
@@ -3,5 +3,5 @@ pub enum SubmitStatus {
|
||||
Idle,
|
||||
Sending,
|
||||
Success,
|
||||
Error(String),
|
||||
Error(()),
|
||||
}
|
||||
Reference in new issue
Block a user