diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index f67007be2..e65a63bcb 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -469,7 +469,7 @@ impl WindowOps for Window { Future::result( clipboard::ClipboardContext::new() .and_then(|mut ctx| ctx.get_contents()) - .with_context(|| format!("Failed to get clipboard: {}", e)), + .context("Failed to get clipboard"), ) } @@ -478,7 +478,7 @@ impl WindowOps for Window { Future::result( clipboard::ClipboardContext::new() .and_then(|mut ctx| ctx.set_contents(text)) - .with_context(|| format!("Failed to set clipboard: {}", e)), + .context("Failed to set clipboard"), ) } } diff --git a/window/src/os/windows/window.rs b/window/src/os/windows/window.rs index 344759970..13e87434d 100644 --- a/window/src/os/windows/window.rs +++ b/window/src/os/windows/window.rs @@ -8,6 +8,7 @@ use crate::{ MouseEventKind, MousePress, Operator, PaintContext, Point, Rect, ScreenPoint, WindowCallbacks, WindowOps, WindowOpsMut, }; +use anyhow::{bail, Context}; use promise::Future; use std::any::Any; use std::cell::RefCell; @@ -423,7 +424,7 @@ impl WindowOps for Window { } fn get_clipboard(&self) -> Future { - Future::result(clipboard_win::get_clipboard_string().context("Error getting clipboard: {}")) + Future::result(clipboard_win::get_clipboard_string().context("Error getting clipboard")) } fn set_clipboard(&self, text: String) -> Future<()> {