mirror of
https://github.com/Xevion/rust-sdl2-emscripten.git
synced 2025-12-06 09:16:20 -06:00
qol: improve store.rs imports
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
use std::{io::Seek, path::PathBuf};
|
|
||||||
|
|
||||||
#[cfg(not(target_os = "emscripten"))]
|
#[cfg(not(target_os = "emscripten"))]
|
||||||
pub struct Store {
|
pub struct Store {
|
||||||
file: std::fs::File,
|
file: std::fs::File,
|
||||||
@@ -21,7 +19,7 @@ impl Store {
|
|||||||
Store { file }
|
Store { file }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_path() -> PathBuf {
|
fn get_path() -> std::path::PathBuf {
|
||||||
use std::env;
|
use std::env;
|
||||||
let mut path = env::current_exe().unwrap();
|
let mut path = env::current_exe().unwrap();
|
||||||
path.pop();
|
path.pop();
|
||||||
@@ -38,7 +36,7 @@ impl Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_volume(&mut self, volume: u32) {
|
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.set_len(0).unwrap();
|
||||||
self.file.seek(std::io::SeekFrom::Start(0)).unwrap();
|
self.file.seek(std::io::SeekFrom::Start(0)).unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user