From 738dcc415160023a46cc547cda72e93e6b5ecc0b Mon Sep 17 00:00:00 2001 From: unsecretised Date: Wed, 25 Mar 2026 15:36:56 +0800 Subject: [PATCH] Simple code fix --- examples/pasteboard/nspasteboard.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pasteboard/nspasteboard.rs b/examples/pasteboard/nspasteboard.rs index 58990ba31..f39b285ee 100644 --- a/examples/pasteboard/nspasteboard.rs +++ b/examples/pasteboard/nspasteboard.rs @@ -23,7 +23,7 @@ pub fn get_text_2(pasteboard: &NSPasteboard) -> Option> { let obj = objects?.firstObject()?; // We now have to convert the object into an NSString, which we know it to // be since that's what we told `readObjectsForClasses:options:` we wanted. - Some(obj.downcast::().unwrap()) + obj.downcast::().ok() } pub fn set_text(pasteboard: &NSPasteboard, text: &NSString) {