Remove clipboard_dummy crate
This commit is contained in:
parent
0f74d59198
commit
9a5cac87bf
5 changed files with 13 additions and 51 deletions
|
|
@ -3,21 +3,26 @@ use crate::ClipboardProvider;
|
|||
use raw_window_handle::HasRawWindowHandle;
|
||||
use std::error::Error;
|
||||
|
||||
pub use clipboard_dummy as dummy;
|
||||
struct Dummy;
|
||||
|
||||
pub fn connect<W: HasRawWindowHandle>(
|
||||
window: &W,
|
||||
_window: &W,
|
||||
) -> Result<Box<dyn ClipboardProvider>, Box<dyn Error>> {
|
||||
let clipboard = Box::new(dummy::Clipboard::connect()?);
|
||||
Ok(clipboard)
|
||||
Ok(Dummy)
|
||||
}
|
||||
|
||||
impl ClipboardProvider for dummy::Clipboard {
|
||||
impl ClipboardProvider for Dummy {
|
||||
fn read(&self) -> Result<String, Box<dyn Error>> {
|
||||
self.read()
|
||||
Err(Error::Unimplemented)
|
||||
}
|
||||
|
||||
fn write(&mut self, contents: String) -> Result<(), Box<dyn Error>> {
|
||||
self.write(contents)
|
||||
Err(Error::Unimplemented)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, thiserror::Error)]
|
||||
enum Error {
|
||||
#[error("unimplemented")]
|
||||
Unimplemented,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue