From 4c39c45f6a97ffb3fd1193010aae9f7e9a11518e Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 24 Apr 2022 17:31:06 -0300 Subject: Add more examples --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 0ed40e2..c5c9b33 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1340,6 +1340,15 @@ impl<'a, 'ph: 'a> ValidContext<'a, 'ph> { } /// Compares two nicks based on the server's case mapping. + /// + /// ```no_run + /// use hexchat_unsafe_plugin::ValidContext; + /// + /// /// Checks if the two nicks below are equal. + /// fn compare_nicks(context: ValidContext<'_, '_>) -> bool { + /// context.nickcmp("hello", "HELLO").is_eq() + /// } + /// ``` pub fn nickcmp(&self, nick1: &str, nick2: &str) -> std::cmp::Ordering { use std::cmp::Ordering; let ph = &self.ph; -- cgit 1.4.1