Skip to content

Commit

Permalink
doc string edits
Browse files Browse the repository at this point in the history
  • Loading branch information
tiftran committed Oct 4, 2023
1 parent f735d5d commit 1df5e5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/suggest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions components/suggest/src/pocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, ""))
}

0 comments on commit 1df5e5a

Please sign in to comment.