diff --git a/src/lib.rs b/src/lib.rs index 9299aa89e..0c5b36318 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -164,7 +164,7 @@ impl EguiClipboard { /// Gets clipboard contents. Returns [`None`] if clipboard provider is unavailable or returns an error. #[must_use] #[cfg(not(target_arch = "wasm32"))] - pub fn get_contents(&self) -> Option { + pub fn get_contents(&mut self) -> Option { self.get_contents_impl() } @@ -185,12 +185,12 @@ impl EguiClipboard { } #[cfg(target_arch = "wasm32")] - fn set_contents_impl(&self, contents: &str) { + fn set_contents_impl(&mut self, contents: &str) { web_clipboard::clipboard_copy(contents.to_owned()); } #[cfg(not(target_arch = "wasm32"))] - fn get_contents_impl(&self) -> Option { + fn get_contents_impl(&mut self) -> Option { if let Some(mut clipboard) = self.get() { match clipboard.get_text() { Ok(contents) => return Some(contents), diff --git a/src/systems.rs b/src/systems.rs index 3544953e2..bbba72fee 100644 --- a/src/systems.rs +++ b/src/systems.rs @@ -56,7 +56,7 @@ pub struct InputResources<'w, 's> { #[cfg(all(feature = "manage_clipboard", target_arch = "wasm32"))] pub egui_clipboard: ResMut<'w, crate::EguiClipboard>, #[cfg(all(feature = "manage_clipboard", not(target_arch = "wasm32")))] - pub egui_clipboard: Res<'w, crate::EguiClipboard>, + pub egui_clipboard: ResMut<'w, crate::EguiClipboard>, pub keyboard_input: Res<'w, Input>, #[system_param(ignore)] _marker: PhantomData<&'s ()>,