Skip to content

Commit

Permalink
Misc formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Seeker14491 committed Jun 12, 2021
1 parent a81cb92 commit e16875d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
3 changes: 2 additions & 1 deletion opener-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
unused_qualifications
)]

use std::{path::PathBuf, process};
use std::path::PathBuf;
use std::process;
use structopt::StructOpt;

#[derive(Debug, StructOpt)]
Expand Down
19 changes: 8 additions & 11 deletions opener/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,13 @@ use crate::macos as sys;
#[cfg(target_os = "windows")]
use crate::windows as sys;

use std::{
borrow::Cow,
env,
error::Error,
ffi::{OsStr, OsString},
fmt::{self, Display, Formatter},
io,
io::Read,
process::{Child, Command, ExitStatus, Stdio},
};
use std::borrow::Cow;
use std::error::Error;
use std::ffi::{OsStr, OsString};
use std::fmt::{self, Display, Formatter};
use std::io::Read;
use std::process::{Child, Command, ExitStatus, Stdio};
use std::{env, io};

/// Opens a file or link with the system default program.
///
Expand Down Expand Up @@ -202,7 +199,7 @@ fn wsl_to_windows_path(path: &OsStr) -> Option<OsString> {
}

#[cfg(not(target_os = "linux"))]
fn wsl_to_windows_path(path: &OsStr) -> Option<OsString> {
fn wsl_to_windows_path(_path: &OsStr) -> Option<OsString> {
unreachable!()
}

Expand Down
8 changes: 3 additions & 5 deletions opener/src/linux_and_more.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::OpenError;
use std::{
ffi::OsStr,
io::Write,
process::{Command, Stdio},
};
use std::ffi::OsStr;
use std::io::Write;
use std::process::{Command, Stdio};

const XDG_OPEN_SCRIPT: &[u8] = include_bytes!("xdg-open");

Expand Down
6 changes: 2 additions & 4 deletions opener/src/macos.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::OpenError;
use std::{
ffi::OsStr,
process::{Command, Stdio},
};
use std::ffi::OsStr;
use std::process::{Command, Stdio};

pub(crate) fn open(path: &OsStr) -> Result<(), OpenError> {
let mut open = Command::new("open")
Expand Down
7 changes: 5 additions & 2 deletions opener/src/windows.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::OpenError;
use std::{ffi::OsStr, io, os::windows::ffi::OsStrExt, ptr};
use winapi::{ctypes::c_int, um::shellapi::ShellExecuteW};
use std::ffi::OsStr;
use std::os::windows::ffi::OsStrExt;
use std::{io, ptr};
use winapi::ctypes::c_int;
use winapi::um::shellapi::ShellExecuteW;

pub(crate) fn open(path: &OsStr) -> Result<(), OpenError> {
const SW_SHOW: c_int = 5;
Expand Down
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
merge_imports = true
imports_granularity = "Module"

0 comments on commit e16875d

Please sign in to comment.