Skip to content

Commit 2e02dfd

Browse files
committed
cargo fmt
1 parent 9489bc6 commit 2e02dfd

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/command.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use std::env;
22
use std::io;
33
use std::process;
4-
use serde_json::{self, json};
4+
5+
use serde_json::json;
56

67
use crate::browser;
78
use crate::config::Config;
@@ -12,18 +13,17 @@ pub enum Command {
1213
ShowManifest,
1314
ShowManifestChromium,
1415
ValidateConfig,
15-
FF2Mpv
16+
FF2Mpv,
1617
}
1718

18-
1919
impl Command {
2020
pub fn execute(&self) -> Result<(), FF2MpvError> {
2121
match self {
2222
Command::ShowHelp => Self::show_help(),
2323
Command::ShowManifest => Self::show_manifest(false),
2424
Command::ShowManifestChromium => Self::show_manifest(true),
2525
Command::ValidateConfig => Self::validate_config(),
26-
Command::FF2Mpv => Self::ff2mpv()
26+
Command::FF2Mpv => Self::ff2mpv(),
2727
}
2828
}
2929

@@ -43,7 +43,10 @@ impl Command {
4343
fn show_manifest(chromium: bool) -> Result<(), FF2MpvError> {
4444
let executable_path = env::current_exe()?;
4545
let allowed_keyvalue = if chromium {
46-
("allowed_origins", "chrome-extension://ephjcajbkgplkjmelpglennepbpmdpjg")
46+
(
47+
"allowed_origins",
48+
"chrome-extension://ephjcajbkgplkjmelpglennepbpmdpjg",
49+
)
4750
} else {
4851
("allowed_extensions", "[email protected]")
4952
};
@@ -72,7 +75,11 @@ impl Command {
7275
fn ff2mpv() -> Result<(), FF2MpvError> {
7376
let config = Config::build();
7477
let ff2mpv_message = browser::get_mpv_message()?;
75-
Command::launch_mpv(config.player_command, config.player_args, &ff2mpv_message.url)?;
78+
Command::launch_mpv(
79+
config.player_command,
80+
config.player_args,
81+
&ff2mpv_message.url,
82+
)?;
7683
browser::send_reply()?;
7784

7885
Ok(())

src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::env;
22
use std::fs;
33
use std::path::PathBuf;
4+
45
use serde::Deserialize;
56

67
use crate::error::FF2MpvError;
@@ -16,7 +17,7 @@ impl Default for Config {
1617
fn default() -> Self {
1718
Self {
1819
player_command: "mpv".to_owned(),
19-
player_args: vec![]
20+
player_args: vec![],
2021
}
2122
}
2223
}

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use std::io;
21
use std::fmt;
32
use std::fmt::Display;
3+
use std::io;
44

55
pub enum FF2MpvError {
66
NoConfig,

0 commit comments

Comments
 (0)