From 9d3a68e22505afe25cbded27d4d57996c0ad2672 Mon Sep 17 00:00:00 2001 From: Xevion Date: Wed, 24 Apr 2024 06:40:09 -0500 Subject: [PATCH] qol: improve store.rs imports --- src/store.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/store.rs b/src/store.rs index cba0c56..a7e3abc 100644 --- a/src/store.rs +++ b/src/store.rs @@ -1,5 +1,3 @@ -use std::{io::Seek, path::PathBuf}; - #[cfg(not(target_os = "emscripten"))] pub struct Store { file: std::fs::File, @@ -10,7 +8,7 @@ pub struct Store; #[cfg(not(target_os = "emscripten"))] impl Store { - pub fn new () -> Self { + pub fn new() -> Self { let path = Store::get_path(); let file = std::fs::OpenOptions::new() .read(true) @@ -21,7 +19,7 @@ impl Store { Store { file } } - fn get_path() -> PathBuf { + fn get_path() -> std::path::PathBuf { use std::env; let mut path = env::current_exe().unwrap(); path.pop(); @@ -38,7 +36,7 @@ impl Store { } pub fn set_volume(&mut self, volume: u32) { - use std::io::Write; + use std::io::{Seek, Write}; self.file.set_len(0).unwrap(); self.file.seek(std::io::SeekFrom::Start(0)).unwrap(); @@ -54,7 +52,7 @@ extern "C" { #[cfg(target_os = "emscripten")] impl Store { - pub fn new () -> Self { + pub fn new() -> Self { Store } @@ -90,4 +88,4 @@ impl Store { String::from(c_str.to_str().unwrap()) } } -} \ No newline at end of file +}