Skip to content

Commit

Permalink
fix compilation on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Gae24 committed Oct 17, 2024
1 parent 0958834 commit f9b466b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/platform/osx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Clipboard {
unsafe { self.pasteboard.clearContents() };
}

fn string_from_type(&self, type: &'static NSString) -> Result<String, Error> {
fn string_from_type(&self, type_: &'static NSString) -> Result<String, Error> {
// XXX: There does not appear to be an alternative for obtaining text without the need for
// autorelease behavior.
autoreleasepool(|_| {
Expand All @@ -133,7 +133,7 @@ impl Clipboard {
})?;

for item in contents {
if let Some(string) = unsafe { item.stringForType(type) } {
if let Some(string) = unsafe { item.stringForType(type_) } {
return Ok(string.to_string());
}
}
Expand Down Expand Up @@ -203,11 +203,11 @@ impl<'clipboard> Get<'clipboard> {
}

pub(crate) fn text(self) -> Result<String, Error> {
self.clipboard.string_from_type(NSPasteboardTypeString)
unsafe { self.clipboard.string_from_type(NSPasteboardTypeString) }
}

pub(crate) fn html(self) -> Result<String, Error> {
self.clipboard.string_from_type(NSPasteboardTypeHTML)
unsafe { self.clipboard.string_from_type(NSPasteboardTypeHTML) }
}

#[cfg(feature = "image-data")]
Expand Down

0 comments on commit f9b466b

Please sign in to comment.