Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Barafu committed Oct 13, 2024
1 parent 562e884 commit 99c24a1
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 6 additions & 4 deletions src-tauri/src/app_settings.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use anyhow::{anyhow, Result};
use directories::ProjectDirs;
use log::{self, info};
Expand Down Expand Up @@ -97,9 +99,9 @@ impl SettingsRaw {
if settings_file.is_file() {
return Ok(settings_file);
}
std::fs::create_dir_all(&settings_dir)?;
std::fs::create_dir_all(settings_dir)?;
File::create(&settings_file)?;
return Ok(settings_file);
Ok(settings_file)
}
}

Expand Down Expand Up @@ -142,7 +144,7 @@ impl Color {
Ok(Color::new_with_alpha(r, g, b, a))
}

pub fn to_hex(&self) -> String {
pub fn as_hex(&self) -> String {
format!("#{:02X}{:02X}{:02X}{:02X}", self.r, self.g, self.b, self.a)
}
}
Expand Down Expand Up @@ -230,7 +232,7 @@ impl ColorScheme {
}
pub fn read_default_schemes() -> BTreeMap<String, ColorScheme> {
let color_scheme_json = include_str!("../assets/color_scheme_data.json");
let color_schemes: Vec<ColorSchemeText> = serde_json::from_str(&color_scheme_json).unwrap();
let color_schemes: Vec<ColorSchemeText> = serde_json::from_str(color_scheme_json).unwrap();
let mut color_schemes_map: BTreeMap<String, ColorScheme> = BTreeMap::new();
for cs_t in color_schemes.into_iter() {
let color_scheme = ColorScheme::from_color_scheme_text(cs_t);
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/dream_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ fn compare_monitors(a: &tauri::window::Monitor, b: &tauri::window::Monitor) -> b

fn calculate_window_position(monitor: &tauri::window::Monitor) -> (f64, f64) {
let (x, y) = (monitor.position().x as f64, monitor.position().y as f64);
let scale = monitor.scale_factor() as f64;
let scale = monitor.scale_factor();
(x / scale, y / scale)
}

0 comments on commit 99c24a1

Please sign in to comment.