Skip to content

Commit

Permalink
Fix docs test of normalize_id
Browse files Browse the repository at this point in the history
  • Loading branch information
lindhe committed Aug 12, 2023
1 parent 4b61ff0 commit d8dd881
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ impl FromStr for WebiconFamily {
/// # Examples
///
/// ```rust
/// assert_eq!("1f600", webicons::normalize_id("grinning", WebiconFamily::from("emojis")));
/// use webicons::{normalize_id, WebiconFamily};
///
/// assert_eq!("1f600", normalize_id("grinning", WebiconFamily::Emojis));
/// ```
pub fn normalize_id(id: &str, family: WebiconFamily) -> String {
if family == WebiconFamily::Emojis && !unic_emoji_char::is_emoji(str_to_char(&id)) {

Check warning on line 54 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Clippy

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:54:82 | 54 | if family == WebiconFamily::Emojis && !unic_emoji_char::is_emoji(str_to_char(&id)) { | ^^^ help: change this to: `id` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 54 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Clippy

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:54:82 | 54 | if family == WebiconFamily::Emojis && !unic_emoji_char::is_emoji(str_to_char(&id)) { | ^^^ help: change this to: `id` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
Expand Down

0 comments on commit d8dd881

Please sign in to comment.