summaryrefslogtreecommitdiff
path: root/src/sheet/loader
diff options
context:
space:
mode:
Diffstat (limited to 'src/sheet/loader')
-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)