Skip to content

Commit

Permalink
docs: Compare f64 values with fuzzy_compare()
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Jul 25, 2023
1 parent 254eb39 commit e7cede8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/zu-docs/src/views/inputs/rating_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use zu::styles::size::Size;
use zu::styles::spacing::Spacing;
use zu::svg_icon::FontSize;
use zu::typography::Typography;
use zu_util::cmp::fuzzy_compare;
use zuicon_material::{Favorite, FavoriteBorder, Star};

use crate::components::demo_box::DemoBox;
Expand Down Expand Up @@ -81,7 +82,7 @@ fn create_hover_feedback_view() -> Html {
let value = 2.5;
let get_label = |index| -> &'static str {
for (key, value) in labels {
if *key == index {
if fuzzy_compare(*key, index) {
return value;
}
}
Expand Down

0 comments on commit e7cede8

Please sign in to comment.