Skip to content

Commit

Permalink
Remove Clipboard::set_text (#2078)
Browse files Browse the repository at this point in the history
* remove Clipboard::set_text

* remove sole usage
  • Loading branch information
teh-cmc authored and jprochazk committed May 11, 2023
1 parent 83d8fcb commit 885961c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion crates/re_viewer/src/misc/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fn start_puffin_viewer() {

if let Err(err) = child {
let cmd = format!("cargo install puffin_viewer && puffin_viewer --url {url}",);
re_viewer_context::Clipboard::with(|clipboard| clipboard.set_text(cmd.clone()));
re_log::warn!("Failed to start puffin_viewer: {err}. Try connecting manually with: {cmd}");

rfd::MessageDialog::new()
Expand Down
11 changes: 0 additions & 11 deletions crates/re_viewer_context/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ impl Clipboard {
}
}

#[cfg(not(target_arch = "wasm32"))] // only used sometimes
pub fn set_text(&mut self, text: String) {
if let Some(clipboard) = &mut self.arboard {
if let Err(err) = clipboard.set_text(text) {
re_log::error!("Failed to copy text to clipboard: {err}",);
} else {
re_log::info!("Text copied to clipboard");
}
}
}

pub fn set_image(&mut self, size: [usize; 2], rgba_unmultiplied: &[u8]) {
let [width, height] = size;
assert_eq!(width * height * 4, rgba_unmultiplied.len());
Expand Down

0 comments on commit 885961c

Please sign in to comment.