Skip to content

Multiply by a glyph-to-default rounded factor when resizing fonts #504

Multiply by a glyph-to-default rounded factor when resizing fonts

Multiply by a glyph-to-default rounded factor when resizing fonts #504

Triggered via push January 19, 2024 16:35
Status Failure
Total duration 2m 50s
Artifacts

rust.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

22 warnings
called `map(..).flatten()` on `Iterator`: src/font/mod.rs#L101
warning: called `map(..).flatten()` on `Iterator` --> src/font/mod.rs:101:22 | 101 | .map(|table| table.scripts) | ______________________^ 102 | | .flatten() | |______________________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|table| table.scripts)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten = note: `#[warn(clippy::map_flatten)]` on by default
used `assert_eq!` with a literal bool: src/font/fallback/mod.rs#L201
warning: used `assert_eq!` with a literal bool --> src/font/fallback/mod.rs:201:33 | 201 | ... assert_eq!(self.monospace_fallbacks.insert(fallback_info), true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison help: replace it with `assert!(..)` | 201 - assert_eq!(self.monospace_fallbacks.insert(fallback_info), true); 201 + assert!(self.monospace_fallbacks.insert(fallback_info)); |
used `assert_eq!` with a literal bool: src/font/fallback/mod.rs#L167
warning: used `assert_eq!` with a literal bool --> src/font/fallback/mod.rs:167:29 | 167 | ... assert_eq!(self.monospace_fallbacks.insert(fallback_info), true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison = note: `#[warn(clippy::bool_assert_comparison)]` on by default help: replace it with `assert!(..)` | 167 - assert_eq!(self.monospace_fallbacks.insert(fallback_info), true); 167 + assert!(self.monospace_fallbacks.insert(fallback_info)); |
item in documentation is missing backticks: src/edit/mod.rs#L293
warning: item in documentation is missing backticks --> src/edit/mod.rs:293:56 | 293 | /// Insert text at specified cursor with specified attrs_list | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown note: the lint level is defined here --> src/lib.rs:84:9 | 84 | #![warn(clippy::doc_markdown)] | ^^^^^^^^^^^^^^^^^^^^ help: try | 293 | /// Insert text at specified cursor with specified `attrs_list` | ~~~~~~~~~~~~
consider adding a `;` to the last statement for consistent formatting: src/edit/mod.rs#L190
warning: consider adding a `;` to the last statement for consistent formatting --> src/edit/mod.rs:190:9 | 190 | self.with_buffer_mut(|buffer| buffer.set_redraw(redraw)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.with_buffer_mut(|buffer| buffer.set_redraw(redraw));` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
docs for function returning `Result` missing `# Errors` section: src/edit/vi.rs#L1109
warning: docs for function returning `Result` missing `# Errors` section --> src/edit/vi.rs:1109:5 | 1109 | / pub fn load_text<P: AsRef<std::path::Path>>( 1110 | | &mut self, 1111 | | path: P, 1112 | | attrs: crate::Attrs, 1113 | | ) -> std::io::Result<()> { | |____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
manual implementation of `Option::map`: src/edit/vi.rs#L1074
warning: manual implementation of `Option::map` --> src/edit/vi.rs:1074:37 | 1074 | / ... if let Some(last) = layout_runs.last() { 1075 | | ... Some(Action::Motion(Motion::GotoLine( 1076 | | ... (last.line_i + first.line_i) / 2, 1077 | | ... ))) 1078 | | ... } else { 1079 | | ... None 1080 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map = note: `#[warn(clippy::manual_map)]` on by default help: try | 1074 ~ layout_runs.last().map(|last| Action::Motion(Motion::GotoLine( 1075 + (last.line_i + first.line_i) / 2, 1076 + ))) |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/vi.rs#L947
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:947:37 | 947 | / ... match text[..cursor.index] 948 | | ... .char_indices() 949 | | ... .filter_map(|(i, c)| { 950 | | ... if c == find_c { ... | 963 | | ... None => {} 964 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 947 ~ if let Some(i) = text[..cursor.index] 948 + .char_indices() 949 + .filter_map(|(i, c)| { 950 + if c == find_c { 951 + let end = i + c.len_utf8(); 952 + if end < cursor.index { 953 + return Some(end); 954 + } 955 + } 956 + None 957 + }) 958 + .last() { 959 + cursor.index = i; 960 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/vi.rs#L927
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:927:37 | 927 | / ... match text[..cursor.index] 928 | | ... .char_indices() 929 | | ... .filter(|&(_, c)| c == find_c) 930 | | ... .last() ... | 935 | | ... None => {} 936 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 927 ~ if let Some((i, _)) = text[..cursor.index] 928 + .char_indices() 929 + .filter(|&(_, c)| c == find_c) 930 + .last() { 931 + cursor.index = i; 932 + } |
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead: src/edit/vi.rs#L821
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead --> src/edit/vi.rs:821:43 | 821 | ... match text[cursor.index..] | _____________________________^ 822 | | ... .char_indices() 823 | | ... .filter(|&(i, c)| i > 0 && c == find_c) 824 | | ... .next() | |_________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next = note: `#[warn(clippy::filter_next)]` on by default help: try | 821 ~ match text[cursor.index..] 822 + .char_indices().find(|&(i, c)| i > 0 && c == find_c) |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/vi.rs#L821
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:821:37 | 821 | / ... match text[cursor.index..] 822 | | ... .char_indices() 823 | | ... .filter(|&(i, c)| i > 0 && c == find_c) 824 | | ... .next() ... | 829 | | ... None => {} 830 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 821 ~ if let Some((i, _)) = text[cursor.index..] 822 + .char_indices() 823 + .filter(|&(i, c)| i > 0 && c == find_c) 824 + .next() { 825 + cursor.index += i; 826 + } |
match expression looks like `matches!` macro: src/edit/vi.rs#L597
warning: match expression looks like `matches!` macro --> src/edit/vi.rs:597:29 | 597 | let has_selection = match editor.selection() { | _____________________________^ 598 | | Selection::None => false, 599 | | _ => true, 600 | | }; | |_________^ help: try: `!matches!(editor.selection(), Selection::None)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
docs for function returning `Result` missing `# Errors` section: src/edit/vi.rs#L192
warning: docs for function returning `Result` missing `# Errors` section --> src/edit/vi.rs:192:5 | 192 | / pub fn load_text<P: AsRef<std::path::Path>>( 193 | | &mut self, 194 | | font_system: &mut FontSystem, 195 | | path: P, 196 | | attrs: crate::Attrs, 197 | | ) -> std::io::Result<()> { | |____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc note: the lint level is defined here --> src/lib.rs:86:9 | 86 | #![warn(clippy::missing_errors_doc)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^
consider adding a `;` to the last statement for consistent formatting: src/edit/syntect.rs#L128
warning: consider adding a `;` to the last statement for consistent formatting --> src/edit/syntect.rs:128:13 | 128 | buffer.set_text(font_system, &text, attrs, Shaping::Advanced) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `buffer.set_text(font_system, &text, attrs, Shaping::Advanced);` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned note: the lint level is defined here --> src/lib.rs:90:9 | 90 | #![warn(clippy::semicolon_if_nothing_returned)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/editor.rs#L507
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/editor.rs:507:9 | 507 | / match self.change.take() { 508 | | Some(pending) => { 509 | | if !pending.items.is_empty() { 510 | | //TODO: is this a good idea? ... | 516 | | None => {} 517 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match = note: `#[warn(clippy::single_match)]` on by default help: try | 507 ~ if let Some(pending) = self.change.take() { 508 + if !pending.items.is_empty() { 509 + //TODO: is this a good idea? 510 + log::warn!("pending change caused apply_change to be ignored!"); 511 + self.change = Some(pending); 512 + return false; 513 + } 514 + } |
docs for function which may panic missing `# Panics` section: src/buffer_line.rs#L200
warning: docs for function which may panic missing `# Panics` section --> src/buffer_line.rs:200:5 | 200 | / pub fn layout_in_buffer( 201 | | &mut self, 202 | | scratch: &mut ShapeBuffer, 203 | | font_system: &mut FontSystem, ... | 207 | | match_mono_width: Option<f32>, 208 | | ) -> &[LayoutLine] { | |______________________^ | note: first possible panic found here --> src/buffer_line.rs:224:9 | 224 | self.layout_opt.as_ref().expect("layout not found") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: src/buffer_line.rs#L157
warning: docs for function which may panic missing `# Panics` section --> src/buffer_line.rs:157:5 | 157 | / pub fn shape_in_buffer( 158 | | &mut self, 159 | | scratch: &mut ShapeBuffer, 160 | | font_system: &mut FontSystem, 161 | | ) -> &ShapeLine { | |___________________^ | note: first possible panic found here --> src/buffer_line.rs:172:9 | 172 | self.shape_opt.as_ref().expect("shape not found") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: src/buffer.rs#L379
warning: docs for function which may panic missing `# Panics` section --> src/buffer.rs:379:5 | 379 | pub fn shape_until_scroll(&mut self, font_system: &mut FontSystem, prune: bool) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/buffer.rs:417:30 | 417 | let layout = self | ______________________________^ 418 | | .line_layout(font_system, line_i) 419 | | .expect("shape_until_scroll invalid line"); | |______________________________________________________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: src/buffer.rs#L331
warning: docs for function which may panic missing `# Panics` section --> src/buffer.rs:331:5 | 331 | / pub fn shape_until_cursor( 332 | | &mut self, 333 | | font_system: &mut FontSystem, 334 | | cursor: Cursor, 335 | | prune: bool, 336 | | ) { | |_____^ | note: first possible panic found here --> src/buffer.rs:339:29 | 339 | let layout_cursor = self | _____________________________^ 340 | | .layout_cursor(font_system, cursor) 341 | | .expect("shape_until_cursor invalid cursor"); | |________________________________________________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: src/buffer.rs#L38
warning: docs for function which may panic missing `# Panics` section --> src/buffer.rs:38:5 | 38 | pub fn highlight(&self, cursor_start: Cursor, cursor_end: Cursor) -> Option<(f32, f32)> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/buffer.rs:60:25 | 60 | let x_end = x_end.expect("end of cursor not found"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: src/attrs.rs#L286
warning: docs for function which may panic missing `# Panics` section --> src/attrs.rs:286:5 | 286 | pub fn split_off(&mut self, index: usize) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/attrs.rs:302:34 | 302 | let (range, attrs) = self | __________________________________^ 303 | | .spans 304 | | .get_key_value(&key.start) 305 | | .map(|v| (v.0.clone(), v.1.clone())) 306 | | .expect("attrs span not found"); | |_______________________________________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc note: the lint level is defined here --> src/lib.rs:88:9 | 88 | #![warn(clippy::missing_panics_doc)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^
build
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/