Code cleanup
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
pub mod api;
|
||||
pub mod flags;
|
||||
pub mod icarus_action;
|
||||
pub mod upload_form;
|
||||
// pub mod upload_form;
|
||||
|
||||
@@ -1,32 +1,3 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Checks {}
|
||||
|
||||
impl Checks {
|
||||
pub fn _is_numeric(text: &str) -> bool {
|
||||
text.parse::<f64>().is_ok()
|
||||
}
|
||||
|
||||
pub fn _index_of_item_in_container<F>(container: &str, item: &char, func: F) -> i32
|
||||
where
|
||||
F: Fn(&char, &char) -> bool,
|
||||
{
|
||||
let mut index = -1;
|
||||
|
||||
for c in container.chars() {
|
||||
if func(&c, item) {
|
||||
index += 1;
|
||||
break;
|
||||
}
|
||||
|
||||
index += 1;
|
||||
}
|
||||
|
||||
index
|
||||
}
|
||||
}
|
||||
|
||||
pub fn exit_program(code: i32) {
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user