aboutsummaryrefslogtreecommitdiffstats
path: root/src/clipboard_store.rs
diff options
context:
space:
mode:
authorTeddy Wing2016-09-05 03:07:52 -0400
committerTeddy Wing2016-09-05 03:07:52 -0400
commit95165cfa696259768dd9173ba2134f8e77025f0e (patch)
treec60fb4bacb250e82efac51a3935fe3f2c56723e4 /src/clipboard_store.rs
parentc1950f087ec24e947ce739875e181ca2ff69f21e (diff)
downloadPassextract-reset-clipboard.tar.bz2
Use ClipboardStore to set clipboardreset-clipboard
Swap ClipboardContext with ClipboardStore to copy to the system clipboard. Also add some documentation to the ClipboardStore::set_context function.
Diffstat (limited to 'src/clipboard_store.rs')
-rw-r--r--src/clipboard_store.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/clipboard_store.rs b/src/clipboard_store.rs
index d334dd6..a7be4f2 100644
--- a/src/clipboard_store.rs
+++ b/src/clipboard_store.rs
@@ -21,14 +21,14 @@ impl ClipboardStore {
)
}
+ /// Set the contents of the system clipboard. Stores the original contents
+ /// of the clipboard the first time the function is run.
pub fn set_contents(&mut self, data: String) -> Result<(), Box<Error>> {
if self.original.is_empty() {
self.original = try!(self.context.get_contents())
}
- // Set new clipboard contents
- // self.context.set_contents(data)
- Ok(())
+ self.context.set_contents(data)
}
pub fn reset() {