diff --git a/components/suggest/src/lib.rs b/components/suggest/src/lib.rs index 9c064be2b2..ba6bb69980 100644 --- a/components/suggest/src/lib.rs +++ b/components/suggest/src/lib.rs @@ -7,7 +7,7 @@ use remote_settings::RemoteSettingsConfig; mod db; mod error; mod keyword; -mod pocket; +pub mod pocket; mod provider; mod rs; mod schema; diff --git a/components/suggest/src/pocket.rs b/components/suggest/src/pocket.rs index 99290ef025..2537b023bf 100644 --- a/components/suggest/src/pocket.rs +++ b/components/suggest/src/pocket.rs @@ -46,10 +46,11 @@ impl ToSql for KeywordConfidence { /// Split the keyword by the first whitespace into the prefix and the suffix. /// Return an empty string as the suffix if there is no whitespace. -/// -/// # Examples: +/// ``` +/// # use suggest::pocket::split_keyword; /// assert_eq!(split_keyword("foo"), ("foo", "")); /// assert_eq!(split_keyword("foo bar baz"), ("foo", "bar baz")); +/// ``` pub fn split_keyword(keyword: &str) -> (&str, &str) { keyword.split_once(' ').unwrap_or((keyword, "")) }