lints: A bunch of extra style lint fixes (#36568)
- **lints: Fix 'doc_lazy_continuation'** - **lints: Fix 'doc_overindented_list_items'** - **inherent_to_string and io_other_error** - **Some more lint fixes** - **lints: enable bool_assert_comparison, match_like_matches_macro and wrong_self_convention** Release Notes: - N/A
This commit is contained in:
parent
a32a264508
commit
cf7c64d77f
92 changed files with 277 additions and 345 deletions
|
@ -667,7 +667,7 @@ pub(super) const DEFAULT_CURSOR_ICON_NAME: &str = "left_ptr";
|
|||
|
||||
impl CursorStyle {
|
||||
#[cfg(any(feature = "wayland", feature = "x11"))]
|
||||
pub(super) fn to_icon_names(&self) -> &'static [&'static str] {
|
||||
pub(super) fn to_icon_names(self) -> &'static [&'static str] {
|
||||
// Based on cursor names from chromium:
|
||||
// https://github.com/chromium/chromium/blob/d3069cf9c973dc3627fa75f64085c6a86c8f41bf/ui/base/cursor/cursor_factory.cc#L113
|
||||
match self {
|
||||
|
@ -990,21 +990,18 @@ mod tests {
|
|||
#[test]
|
||||
fn test_is_within_click_distance() {
|
||||
let zero = Point::new(px(0.0), px(0.0));
|
||||
assert_eq!(
|
||||
is_within_click_distance(zero, Point::new(px(5.0), px(5.0))),
|
||||
true
|
||||
);
|
||||
assert_eq!(
|
||||
is_within_click_distance(zero, Point::new(px(-4.9), px(5.0))),
|
||||
true
|
||||
);
|
||||
assert_eq!(
|
||||
is_within_click_distance(Point::new(px(3.0), px(2.0)), Point::new(px(-2.0), px(-2.0))),
|
||||
true
|
||||
);
|
||||
assert_eq!(
|
||||
is_within_click_distance(zero, Point::new(px(5.0), px(5.1))),
|
||||
false
|
||||
);
|
||||
assert!(is_within_click_distance(zero, Point::new(px(5.0), px(5.0))));
|
||||
assert!(is_within_click_distance(
|
||||
zero,
|
||||
Point::new(px(-4.9), px(5.0))
|
||||
));
|
||||
assert!(is_within_click_distance(
|
||||
Point::new(px(3.0), px(2.0)),
|
||||
Point::new(px(-2.0), px(-2.0))
|
||||
));
|
||||
assert!(!is_within_click_distance(
|
||||
zero,
|
||||
Point::new(px(5.0), px(5.1))
|
||||
),);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue