mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 08:15:29 +00:00
docx: satisfy clippy's range-contains lint in the chart title guard
main's gate fails here for every pull request: `!(r < 1.0 || r > 359.0)` is exactly what `manual_range_contains` rejects. Express the same range as `(1.0..=359.0).contains(&r)`.
This commit is contained in:
1 file changed
+1
-1
@@ -212,7 +212,7 @@ fn title_left(c: &Chart, cat_on: bool, val_on: bool, area_w: f32) -> f32 {
|
||||
fn flat_title_lines(c: &Chart, area_w: f32) -> Option<Vec<String>> {
|
||||
let left = if c.horizontal { &c.cat } else { &c.val };
|
||||
let r = left.title_rot?.rem_euclid(360.0);
|
||||
if !(r < 1.0 || r > 359.0) {
|
||||
if !(1.0..=359.0).contains(&r) {
|
||||
return None;
|
||||
}
|
||||
let width = if area_w.is_finite() { (area_w * 0.18).max(1.0) } else { 1.0 };
|
||||
|
||||
Reference in new issue
Block a user