Skip to content

Commit

Permalink
fix warning+clippy; fix wrong error message
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyTurtleDev committed Oct 24, 2023
1 parent c69e852 commit 1ac1a37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion more-wallpapers/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum WallpaperError {
Dbus(#[from] rustbus::connection::Error),

#[cfg(target_os = "linux")]
#[error("Dbus error: {0}")]
#[error("failed to serialize json output: {0}")]
SerdeJson(#[from] serde_json::Error),

#[cfg(target_os = "linux")]
Expand Down
2 changes: 1 addition & 1 deletion more-wallpapers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl WallpaperBuilder {
P: AsRef<Utf8Path>,
F: FnMut(&Screen) -> (P, Mode),
{
for mut screen in self.screens.iter_mut() {
for screen in self.screens.iter_mut() {
let tuple = f(screen);
let path = tuple.0.as_ref();
let path = path.canonicalize_utf8().context(path)?;
Expand Down
15 changes: 2 additions & 13 deletions more-wallpapers/src/linux/sway.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use super::check_command_error;
use crate::{
error::{CommandError, WallpaperError},
linux::{run, x11},
Mode, Screen,
};
use crate::{error::WallpaperError, Mode, Screen};
use serde::Deserialize;
use std::{io::StdoutLock, process::Command};
use std::process::Command;
use strum_macros::{Display, EnumString};

#[derive(Debug, Clone, Copy, EnumString, Display, PartialEq, Eq)]
Expand Down Expand Up @@ -45,16 +41,9 @@ impl From<SMode> for Mode {
#[derive(Deserialize, Debug)]
struct OutputScreens {
name: String,
current_mode: OutputMode,
active: bool,
}

#[derive(Deserialize, Debug)]
struct OutputMode {
width: usize,
height: usize,
}

pub(crate) fn get_screens() -> Result<Vec<Screen>, WallpaperError> {
let mut command = Command::new("swaymsg");
command.args(["-t", "get_outputs"]);
Expand Down

0 comments on commit 1ac1a37

Please sign in to comment.