From 4ed5078aa8c22a99e6afc5e712059aa3ac1879dc Mon Sep 17 00:00:00 2001 From: eNV25 Date: Tue, 14 May 2024 18:02:17 +0200 Subject: [PATCH] cargo fmt --- src/command.rs | 5 +++-- src/config.rs | 7 ++++--- src/error.rs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/command.rs b/src/command.rs index ae87e59..c92c4a6 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1,7 +1,8 @@ use std::env; use std::io; use std::process; -use serde_json::{self, json}; + +use serde_json::json; use crate::browser; use crate::config::Config; @@ -94,7 +95,7 @@ impl Command { // NOTE: On Windows, browser spawns process into a Job object. // NOTE: We need to detach player from the job, so it won't get killed after we're done, // NOTE: See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging#closing_the_native_app - #[cfg(target_family = "windows")] + #[cfg(windows)] { use std::os::windows::process::CommandExt; const CREATE_BREAKAWAY_FROM_JOB: u32 = 0x01000000; diff --git a/src/config.rs b/src/config.rs index d15f49e..096d860 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,7 @@ use std::env; use std::fs; use std::path::PathBuf; + use serde::Deserialize; use crate::error::FF2MpvError; @@ -16,7 +17,7 @@ impl Default for Config { fn default() -> Self { Self { player_command: "mpv".to_owned(), - player_args: vec![] + player_args: vec![], } } } @@ -40,7 +41,7 @@ impl Config { Ok(config) } - #[cfg(target_family = "unix")] + #[cfg(unix)] fn get_config_location() -> PathBuf { let mut path = PathBuf::new(); @@ -57,7 +58,7 @@ impl Config { path } - #[cfg(target_family = "windows")] + #[cfg(windows)] fn get_config_location() -> PathBuf { let mut path = PathBuf::new(); let appdata = env::var("APPDATA").unwrap(); diff --git a/src/error.rs b/src/error.rs index d39c5fa..5d74883 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,6 @@ -use std::io; use std::fmt; use std::fmt::Display; +use std::io; pub enum FF2MpvError { NoConfig,