Skip to content

Commit e16875d

Browse files
committed
Misc formatting changes
1 parent a81cb92 commit e16875d

File tree

6 files changed

+21
-24
lines changed

6 files changed

+21
-24
lines changed

opener-bin/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
unused_qualifications
77
)]
88

9-
use std::{path::PathBuf, process};
9+
use std::path::PathBuf;
10+
use std::process;
1011
use structopt::StructOpt;
1112

1213
#[derive(Debug, StructOpt)]

opener/src/lib.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,13 @@ use crate::macos as sys;
4040
#[cfg(target_os = "windows")]
4141
use crate::windows as sys;
4242

43-
use std::{
44-
borrow::Cow,
45-
env,
46-
error::Error,
47-
ffi::{OsStr, OsString},
48-
fmt::{self, Display, Formatter},
49-
io,
50-
io::Read,
51-
process::{Child, Command, ExitStatus, Stdio},
52-
};
43+
use std::borrow::Cow;
44+
use std::error::Error;
45+
use std::ffi::{OsStr, OsString};
46+
use std::fmt::{self, Display, Formatter};
47+
use std::io::Read;
48+
use std::process::{Child, Command, ExitStatus, Stdio};
49+
use std::{env, io};
5350

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

204201
#[cfg(not(target_os = "linux"))]
205-
fn wsl_to_windows_path(path: &OsStr) -> Option<OsString> {
202+
fn wsl_to_windows_path(_path: &OsStr) -> Option<OsString> {
206203
unreachable!()
207204
}
208205

opener/src/linux_and_more.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use crate::OpenError;
2-
use std::{
3-
ffi::OsStr,
4-
io::Write,
5-
process::{Command, Stdio},
6-
};
2+
use std::ffi::OsStr;
3+
use std::io::Write;
4+
use std::process::{Command, Stdio};
75

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

opener/src/macos.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use crate::OpenError;
2-
use std::{
3-
ffi::OsStr,
4-
process::{Command, Stdio},
5-
};
2+
use std::ffi::OsStr;
3+
use std::process::{Command, Stdio};
64

75
pub(crate) fn open(path: &OsStr) -> Result<(), OpenError> {
86
let mut open = Command::new("open")

opener/src/windows.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use crate::OpenError;
2-
use std::{ffi::OsStr, io, os::windows::ffi::OsStrExt, ptr};
3-
use winapi::{ctypes::c_int, um::shellapi::ShellExecuteW};
2+
use std::ffi::OsStr;
3+
use std::os::windows::ffi::OsStrExt;
4+
use std::{io, ptr};
5+
use winapi::ctypes::c_int;
6+
use winapi::um::shellapi::ShellExecuteW;
47

58
pub(crate) fn open(path: &OsStr) -> Result<(), OpenError> {
69
const SW_SHOW: c_int = 5;

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
merge_imports = true
1+
imports_granularity = "Module"

0 commit comments

Comments
 (0)