summaryrefslogtreecommitdiffstats
path: root/copypasta
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2019-11-02 01:25:34 +0100
committerGitHub <noreply@github.com>2019-11-02 01:25:34 +0100
commit356e4186366d11ab0bcb5f25923a92cb3960bc3c (patch)
treef6b9c8f3b4b88de7efa14b9ed27b0b967daedbab /copypasta
parent3e5511a6935127362e809065093717339c70df04 (diff)
Fix clippy warnings
Diffstat (limited to 'copypasta')
-rw-r--r--copypasta/src/wayland_clipboard.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/copypasta/src/wayland_clipboard.rs b/copypasta/src/wayland_clipboard.rs
index 7b9de832..0fd154e5 100644
--- a/copypasta/src/wayland_clipboard.rs
+++ b/copypasta/src/wayland_clipboard.rs
@@ -37,6 +37,12 @@ pub fn create_clipboards(display: &Display) -> (Primary, Clipboard) {
(Primary { context: context.clone() }, Clipboard { context })
}
+/// Create new clipboard from a raw display pointer.
+///
+/// # Safety
+///
+/// Since the type of the display is a raw pointer, it's the responsibility of the callee to make
+/// sure that the passed pointer is a valid Wayland display.
pub unsafe fn create_clipboards_from_external(display: *mut c_void) -> (Primary, Clipboard) {
let context =
Arc::new(Mutex::new(WaylandClipboard::new_from_external(display as *mut wl_display)));