Update documentation

This commit is contained in:
Lucas Timmins 2019-04-27 19:01:41 +08:00
parent 61ac558555
commit f84c9be419

View file

@ -7,8 +7,8 @@
//! let (display, _) = //! let (display, _) =
//! Display::connect_to_env().expect("Failed to connect to the wayland server."); //! Display::connect_to_env().expect("Failed to connect to the wayland server.");
//! let mut clipboard = smithay_clipboard::WaylandClipboard::new_threaded(&display); //! let mut clipboard = smithay_clipboard::WaylandClipboard::new_threaded(&display);
//! clipboard.store("seat0", "Test data"); //! clipboard.store(None, "Test data");
//! println!("{}", clipboard.load("seat0")); //! println!("{}", clipboard.load(None));
//! ``` //! ```
#![warn(missing_docs)] #![warn(missing_docs)]
@ -322,8 +322,10 @@ impl WaylandClipboard {
/// Returns text from the wayland clipboard /// Returns text from the wayland clipboard
/// ///
/// Must be provided with a seat name and that seat must be in /// If provided with a seat name that seat must be in
/// focus to work /// focus to work. Otherwise if no seat name is provided
/// the name of the seat to last generate a key or pointer event
/// is used
pub fn load(&mut self, seat_name: Option<String>) -> String { pub fn load(&mut self, seat_name: Option<String>) -> String {
self.request_send self.request_send
.send(WaylandRequest::Load(seat_name.unwrap_or_else(|| { .send(WaylandRequest::Load(seat_name.unwrap_or_else(|| {
@ -335,8 +337,10 @@ impl WaylandClipboard {
/// Stores text in the wayland clipboard /// Stores text in the wayland clipboard
/// ///
/// Must be provided with a seat name and that seat must be in /// If provided with a seat name that seat must be in
/// focus to work /// focus to work. Otherwise if no seat name is provided
/// the name of the seat to last generate a key or pointer event
/// is used
pub fn store(&mut self, seat_name: Option<String>, text: String) { pub fn store(&mut self, seat_name: Option<String>, text: String) {
self.request_send self.request_send
.send(WaylandRequest::Store( .send(WaylandRequest::Store(