mirror of https://github.com/MedzikUser/imgurs
rustfmt
This commit is contained in:
parent
a4a17a4fc5
commit
2c22737070
|
@ -3,7 +3,10 @@
|
||||||
not(any(target_os = "macos", target_os = "android", target_os = "emscripten"))
|
not(any(target_os = "macos", target_os = "android", target_os = "emscripten"))
|
||||||
))]
|
))]
|
||||||
pub fn set_clipboard(content: String) {
|
pub fn set_clipboard(content: String) {
|
||||||
use std::{process::{Command, Stdio}, io::Write};
|
use std::{
|
||||||
|
io::Write,
|
||||||
|
process::{Command, Stdio},
|
||||||
|
};
|
||||||
|
|
||||||
let mut child = Command::new("xsel")
|
let mut child = Command::new("xsel")
|
||||||
.arg("--input")
|
.arg("--input")
|
||||||
|
@ -12,7 +15,12 @@ pub fn set_clipboard(content: String) {
|
||||||
.spawn()
|
.spawn()
|
||||||
.expect("execute command xsel");
|
.expect("execute command xsel");
|
||||||
|
|
||||||
child.stdin.as_mut().unwrap().write_all(content.as_bytes()).expect("execute command");
|
child
|
||||||
|
.stdin
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.write_all(content.as_bytes())
|
||||||
|
.expect("execute command");
|
||||||
child.wait_with_output().unwrap();
|
child.wait_with_output().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue