From bce9e8fc9637ef05fc26bc3ed17867e142fa2a2d Mon Sep 17 00:00:00 2001 From: AlexKnauth Date: Mon, 11 Dec 2023 21:20:07 -0500 Subject: [PATCH] cargo fmt --- src/main.rs | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index cf839b4..bd9199b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use std::{ collections::BTreeMap, fs::{self, File}, io::Write, - path::{PathBuf, Path}, + path::{Path, PathBuf}, sync::{ atomic::{AtomicU64, AtomicUsize}, Arc, Mutex, RwLock, RwLockWriteGuard, @@ -27,8 +27,8 @@ use egui_file::FileDialog; use egui_plot::{Bar, BarChart, Legend, Plot, VLine}; use hdrhistogram::Histogram; use indexmap::IndexMap; +use livesplit_auto_splitting::wasi_path::{path_to_wasi, wasi_to_path}; use livesplit_auto_splitting::{settings, time, Config, Runtime, Timer, TimerState}; -use livesplit_auto_splitting::wasi_path::{wasi_to_path, path_to_wasi}; mod clear_vec; @@ -611,19 +611,25 @@ impl egui_dock::TabViewer for TabViewer<'_> { settings::WidgetKind::FileSelection { ref filter } => { ui.add_space(spacing); let settings_map = runtime.settings_map(); - let current_path: Option = match settings_map.get(&setting.key) { - Some(settings::Value::String(path)) => wasi_to_path(path), - _ => None, - }; - let filter_pieces: Vec = filter.split('*').map(String::from).collect(); + let current_path: Option = + match settings_map.get(&setting.key) { + Some(settings::Value::String(path)) => wasi_to_path(path), + _ => None, + }; + let filter_pieces: Vec = + filter.split('*').map(String::from).collect(); if ui.button(&*setting.description).clicked() { - let mut dialog = FileDialog::open_file(current_path) - .filter(Box::new(move |p: &Path| { + let mut dialog = FileDialog::open_file(current_path).filter( + Box::new(move |p: &Path| { let s = p.to_string_lossy(); filter_pieces.iter().all(|f| s.contains(f)) - })); + }), + ); dialog.open(); - self.state.open_file_dialog = Some((dialog, FileDialogInfo::SettingsWidget(setting.key.clone()))); + self.state.open_file_dialog = Some(( + dialog, + FileDialogInfo::SettingsWidget(setting.key.clone()), + )); } } }); @@ -824,7 +830,9 @@ impl App for Debugger { FileDialogInfo::Script => self.state.set_script_path(file), FileDialogInfo::SettingsWidget(key) => { if let Some(s) = path_to_wasi(&file) { - if let Some(runtime) = &*self.state.shared_state.runtime.read().unwrap() { + if let Some(runtime) = + &*self.state.shared_state.runtime.read().unwrap() + { loop { let old = runtime.settings_map(); let mut new = old.clone();