We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e8433c commit b4832ebCopy full SHA for b4832eb
src/clip.rs
@@ -6,15 +6,13 @@ pub fn copy_to_clipboard(content: &str) -> anyhow::Result<()> {
6
Err(e) => return Err(anyhow::anyhow!("ClipboardContext Error: {}", e)),
7
};
8
9
- match ctx.set_contents(content.to_owned()) {
10
- Ok(ctx) => ctx,
11
- Err(e) => return Err(anyhow::anyhow!("Set Contents Error: {}", e)),
12
- };
+ if let Err(e) = ctx.set_contents(content.to_owned()) {
+ return Err(anyhow::anyhow!("Set Contents Error: {}", e));
+ }
13
14
- match ctx.get_contents() {
15
16
- Err(e) => return Err(anyhow::anyhow!("Get Contents Error: {}", e)),
17
+ if let Err(e) = ctx.get_contents() {
+ return Err(anyhow::anyhow!("Get Contents Error: {}", e));
18
19
Ok(())
20
}
0 commit comments