summaryrefslogtreecommitdiff
path: root/src/sheet
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-10 19:26:52 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-10 19:26:52 +0200
commitf4c019a200f548fcf28be5c8557572ab78a1e2e8 (patch)
tree44a23ca87f4e47248c3f59ad7382e8e0547bb832 /src/sheet
parent5ff507db2f6667a0305e2382037710f6082d75da (diff)
code cleanup
Diffstat (limited to 'src/sheet')
-rw-r--r--src/sheet/loader/mod.rs4
-rw-r--r--src/sheet/loader/native/csv.rs6
2 files changed, 4 insertions, 6 deletions
diff --git a/src/sheet/loader/mod.rs b/src/sheet/loader/mod.rs
index 0e083fe..6f731db 100644
--- a/src/sheet/loader/mod.rs
+++ b/src/sheet/loader/mod.rs
@@ -35,7 +35,7 @@ impl Loader {
};
}
- return None;
+ None
}
pub fn add(&mut self, extension: String, func: Box<dyn Runnable<String, Tablized>>) {
@@ -43,7 +43,7 @@ impl Loader {
}
pub fn get() -> &'static mut Self {
- static mut GLOBAL_LOADER: Lazy<Loader> = Lazy::new(|| Loader::new());
+ static mut GLOBAL_LOADER: Lazy<Loader> = Lazy::new(Loader::new);
unsafe { &mut *addr_of_mut!(GLOBAL_LOADER) }
}
}
diff --git a/src/sheet/loader/native/csv.rs b/src/sheet/loader/native/csv.rs
index 4a8f05d..6f81645 100644
--- a/src/sheet/loader/native/csv.rs
+++ b/src/sheet/loader/native/csv.rs
@@ -9,10 +9,8 @@ pub fn load_csv(path: String) -> Tablized {
let mut table = Vec::new();
- for result in csv_reader.records() {
- if let Ok(record) = result {
- table.push(record.iter().map(|s| Cell::from(s)).collect::<Vec<Cell>>())
- }
+ for record in csv_reader.records().flatten() {
+ table.push(record.iter().map(Cell::from).collect::<Vec<Cell>>())
}
Tablized::Vector(table)