Skip to content

fix: avoids panic

fix: avoids panic #698

Triggered via push December 22, 2024 02:16
Status Failure
Total duration 3m 30s
Artifacts

rust.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

1 error and 55 warnings
build
Process completed with exit code 101.
item in documentation is missing backticks: src/shape_run_cache.rs#L36
warning: item in documentation is missing backticks --> src/shape_run_cache.rs:36:61 | 36 | /// Remove anything in the cache with an age older than keep_ages | ^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 36 | /// Remove anything in the cache with an age older than `keep_ages` | ~~~~~~~~~~~
manual saturating arithmetic: src/shape.rs#L390
warning: manual saturating arithmetic --> src/shape.rs:390:19 | 390 | let end = min(attrs_range.end, end_run) | ___________________^ 391 | | .checked_sub(start_run) 392 | | .unwrap_or(0); | |_________________________^ help: consider using `saturating_sub`: `min(attrs_range.end, end_run).saturating_sub(start_run)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
manual saturating arithmetic: src/shape.rs#L387
warning: manual saturating arithmetic --> src/shape.rs:387:21 | 387 | let start = max(attrs_range.start, start_run) | _____________________^ 388 | | .checked_sub(start_run) 389 | | .unwrap_or(0); | |_________________________^ help: consider using `saturating_sub`: `max(attrs_range.start, start_run).saturating_sub(start_run)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic = note: `#[warn(clippy::manual_saturating_arithmetic)]` on by default
the borrowed expression implements the required traits: src/line_ending.rs#L55
warning: the borrowed expression implements the required traits --> src/line_ending.rs:55:49 | 55 | match self.string[start..self.end].find(&['\r', '\n']) { | ^^^^^^^^^^^^^ help: change this to: `['\r', '\n']` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
the following explicit lifetimes could be elided: 'a: src/line_ending.rs#L51
warning: the following explicit lifetimes could be elided: 'a --> src/line_ending.rs:51:6 | 51 | impl<'a> Iterator for LineIter<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 51 - impl<'a> Iterator for LineIter<'a> { 51 + impl Iterator for LineIter<'_> { |
item in documentation is missing backticks: src/layout.rs#L61
warning: item in documentation is missing backticks --> src/layout.rs:61:25 | 61 | /// Cache key, see [CacheKey] | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 61 | /// Cache key, see [`CacheKey`] | ~~~~~~~~~~
item in documentation is missing backticks: src/layout.rs#L31
warning: item in documentation is missing backticks --> src/layout.rs:31:17 | 31 | /// Unicode BiDi embedding level, character is left-to-right if `level` is divisible by 2 | ^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 31 | /// Unicode `BiDi` embedding level, character is left-to-right if `level` is divisible by 2 | ~~~~~~
the following explicit lifetimes could be elided: 'a: src/font/system.rs#L413
warning: the following explicit lifetimes could be elided: 'a --> src/font/system.rs:413:6 | 413 | impl<'a, T> DerefMut for BorrowedWithFontSystem<'a, T> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 413 - impl<'a, T> DerefMut for BorrowedWithFontSystem<'a, T> { 413 + impl<T> DerefMut for BorrowedWithFontSystem<'_, T> { |
the following explicit lifetimes could be elided: 'a: src/font/system.rs#L405
warning: the following explicit lifetimes could be elided: 'a --> src/font/system.rs:405:6 | 405 | impl<'a, T> Deref for BorrowedWithFontSystem<'a, T> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 405 - impl<'a, T> Deref for BorrowedWithFontSystem<'a, T> { 405 + impl<T> Deref for BorrowedWithFontSystem<'_, T> { |
item in documentation is missing backticks: src/font/system.rs#L109
warning: item in documentation is missing backticks --> src/font/system.rs:109:27 | 109 | /// Buffer for use in FontFallbackIter. | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 109 | /// Buffer for use in `FontFallbackIter`. | ~~~~~~~~~~~~~~~~~~
current MSRV (Minimum Supported Rust Version) is `1.65.0` but this item is stable since `1.66.0`: src/font/fallback/mod.rs#L255
warning: current MSRV (Minimum Supported Rust Version) is `1.65.0` but this item is stable since `1.66.0` --> src/font/fallback/mod.rs:255:86 | 255 | if let Some(fallback_info) = self.font_system.monospace_fallbacks_buffer.pop_first() { | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
current MSRV (Minimum Supported Rust Version) is `1.65.0` but this item is stable since `1.66.0`: src/font/fallback/mod.rs#L146
warning: current MSRV (Minimum Supported Rust Version) is `1.65.0` but this item is stable since `1.66.0` --> src/font/fallback/mod.rs:146:82 | 146 | if let Some(fallback_info) = self.font_system.monospace_fallbacks_buffer.pop_first() { | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv = note: `#[warn(clippy::incompatible_msrv)]` on by default
the following explicit lifetimes could be elided: 'a: src/font/fallback/mod.rs#L143
warning: the following explicit lifetimes could be elided: 'a --> src/font/fallback/mod.rs:143:6 | 143 | impl<'a> Iterator for FontFallbackIter<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 143 - impl<'a> Iterator for FontFallbackIter<'a> { 143 + impl Iterator for FontFallbackIter<'_> { |
the following explicit lifetimes could be elided: 'font_system: src/edit/mod.rs#L337
warning: the following explicit lifetimes could be elided: 'font_system --> src/edit/mod.rs:337:6 | 337 | impl<'font_system, 'buffer, E: Edit<'buffer>> BorrowedWithFontSystem<'font_system, E> { | ^^^^^^^^^^^^ ^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 337 - impl<'font_system, 'buffer, E: Edit<'buffer>> BorrowedWithFontSystem<'font_system, E> { 337 + impl<'buffer, E: Edit<'buffer>> BorrowedWithFontSystem<'_, E> { |
item in documentation is missing backticks: src/edit/mod.rs#L303
warning: item in documentation is missing backticks --> src/edit/mod.rs:303:56 | 303 | /// 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 help: try | 303 | /// Insert text at specified cursor with specified `attrs_list` | ~~~~~~~~~~~~
consider adding a `;` to the last statement for consistent formatting: src/edit/mod.rs#L200
warning: consider adding a `;` to the last statement for consistent formatting --> src/edit/mod.rs:200:9 | 200 | 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
the following explicit lifetimes could be elided: 'buffer: src/edit/mod.rs#L96
warning: the following explicit lifetimes could be elided: 'buffer --> src/edit/mod.rs:96:6 | 96 | impl<'buffer> From<Arc<Buffer>> for BufferRef<'buffer> { | ^^^^^^^ ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 96 - impl<'buffer> From<Arc<Buffer>> for BufferRef<'buffer> { 96 + impl From<Arc<Buffer>> for BufferRef<'_> { |
the following explicit lifetimes could be elided: 'buffer: src/edit/mod.rs#L84
warning: the following explicit lifetimes could be elided: 'buffer --> src/edit/mod.rs:84:6 | 84 | impl<'buffer> From<Buffer> for BufferRef<'buffer> { | ^^^^^^^ ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 84 - impl<'buffer> From<Buffer> for BufferRef<'buffer> { 84 + impl From<Buffer> for BufferRef<'_> { |
the following explicit lifetimes could be elided: 'buffer: src/edit/mod.rs#L74
warning: the following explicit lifetimes could be elided: 'buffer --> src/edit/mod.rs:74:6 | 74 | impl<'buffer> Clone for BufferRef<'buffer> { | ^^^^^^^ ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 74 - impl<'buffer> Clone for BufferRef<'buffer> { 74 + impl Clone for BufferRef<'_> { |
docs for function returning `Result` missing `# Errors` section: src/edit/vi.rs#L1175
warning: docs for function returning `Result` missing `# Errors` section --> src/edit/vi.rs:1175:5 | 1175 | / pub fn load_text<P: AsRef<std::path::Path>>( 1176 | | &mut self, 1177 | | path: P, 1178 | | attrs: crate::Attrs, 1179 | | ) -> std::io::Result<()> { | |____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
the following explicit lifetimes could be elided: 'font_system, 'syntax_system, 'buffer: src/edit/vi.rs#L1170
warning: the following explicit lifetimes could be elided: 'font_system, 'syntax_system, 'buffer --> src/edit/vi.rs:1170:6 | 1170 | impl<'font_system, 'syntax_system, 'buffer> | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^ 1171 | BorrowedWithFontSystem<'font_system, ViEditor<'syntax_system, 'buffer>> | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 1170 ~ impl 1171 ~ BorrowedWithFontSystem<'_, ViEditor<'_, '_>> |
manual implementation of `Option::map`: src/edit/vi.rs#L1136
warning: manual implementation of `Option::map` --> src/edit/vi.rs:1136:37 | 1136 | / ... if let Some(last) = layout_runs.last() { 1137 | | ... Some(Action::Motion(Motion::GotoLine( 1138 | | ... (last.line_i + first.line_i) / 2, 1139 | | ... ))) 1140 | | ... } else { 1141 | | ... None 1142 | | ... } | |_______________________^ | = 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 | 1136 ~ layout_runs.last().map(|last| Action::Motion(Motion::GotoLine( 1137 + (last.line_i + first.line_i) / 2, 1138 + ))) |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/vi.rs#L1009
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:1009:37 | 1009 | / ... match text[..cursor.index] 1010 | | ... .char_indices() 1011 | | ... .filter_map(|(i, c)| { 1012 | | ... if c == find_c { ... | 1025 | | ... None => {} 1026 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 1009 ~ if let Some(i) = text[..cursor.index] 1010 + .char_indices() 1011 + .filter_map(|(i, c)| { 1012 + if c == find_c { 1013 + let end = i + c.len_utf8(); 1014 + if end < cursor.index { 1015 + return Some(end); 1016 + } 1017 + } 1018 + None 1019 + }) 1020 + .last() { 1021 + cursor.index = i; 1022 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/vi.rs#L989
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:989:37 | 989 | / ... match text[..cursor.index] 990 | | ... .char_indices() 991 | | ... .filter(|&(_, c)| c == find_c) 992 | | ... .last() ... | 997 | | ... None => {} 998 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 989 ~ if let Some((i, _)) = text[..cursor.index] 990 + .char_indices() 991 + .filter(|&(_, c)| c == find_c) 992 + .last() { 993 + cursor.index = i; 994 + } |
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead: src/edit/vi.rs#L883
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead --> src/edit/vi.rs:883:43 | 883 | ... match text[cursor.index..] | _____________________________^ 884 | | ... .char_indices() 885 | | ... .filter(|&(i, c)| i > 0 && c == find_c) 886 | | ... .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 | 883 ~ match text[cursor.index..] 884 + .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#L883
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:883:37 | 883 | / ... match text[cursor.index..] 884 | | ... .char_indices() 885 | | ... .filter(|&(i, c)| i > 0 && c == find_c) 886 | | ... .next() ... | 891 | | ... None => {} 892 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 883 ~ if let Some((i, _)) = text[cursor.index..] 884 + .char_indices() 885 + .filter(|&(i, c)| i > 0 && c == find_c) 886 + .next() { 887 + cursor.index += i; 888 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/vi.rs#L781
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/vi.rs:781:29 | 781 | / ... match &self.search_opt { 782 | | ... Some((value, _)) => { 783 | | ... if search(editor, value, forwards) { 784 | | ... let mut cursor = editor.cursor(); ... | 791 | | ... None => {} 792 | | ... } | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 781 ~ if let Some((value, _)) = &self.search_opt { 782 + if search(editor, value, forwards) { 783 + let mut cursor = editor.cursor(); 784 + editor.set_selection(Selection::Normal(cursor)); 785 + //TODO: traverse lines if necessary 786 + cursor.index += value.len(); 787 + editor.set_cursor(cursor); 788 + } 789 + } |
match expression looks like `matches!` macro: src/edit/vi.rs#L649
warning: match expression looks like `matches!` macro --> src/edit/vi.rs:649:29 | 649 | let has_selection = match editor.selection() { | _____________________________^ 650 | | Selection::None => false, 651 | | _ => true, 652 | | }; | |_________^ 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
the following explicit lifetimes could be elided: 'syntax_system: src/edit/vi.rs#L520
warning: the following explicit lifetimes could be elided: 'syntax_system --> src/edit/vi.rs:520:6 | 520 | impl<'syntax_system, 'buffer> Edit<'buffer> for ViEditor<'syntax_system, 'buffer> { | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 520 - impl<'syntax_system, 'buffer> Edit<'buffer> for ViEditor<'syntax_system, 'buffer> { 520 + impl<'buffer> Edit<'buffer> for ViEditor<'_, 'buffer> { |
docs for function returning `Result` missing `# Errors` section: src/edit/vi.rs#L213
warning: docs for function returning `Result` missing `# Errors` section --> src/edit/vi.rs:213:5 | 213 | / pub fn load_text<P: AsRef<std::path::Path>>( 214 | | &mut self, 215 | | font_system: &mut FontSystem, 216 | | path: P, 217 | | attrs: crate::Attrs, 218 | | ) -> 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)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^
the following explicit lifetimes could be elided: 'font_system, 'syntax_system, 'buffer: src/edit/syntect.rs#L443
warning: the following explicit lifetimes could be elided: 'font_system, 'syntax_system, 'buffer --> src/edit/syntect.rs:443:6 | 443 | impl<'font_system, 'syntax_system, 'buffer> | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^ 444 | BorrowedWithFontSystem<'font_system, SyntaxEditor<'syntax_system, 'buffer>> | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 443 ~ impl 444 ~ BorrowedWithFontSystem<'_, SyntaxEditor<'_, '_>> |
the following explicit lifetimes could be elided: 'syntax_system: src/edit/syntect.rs#L238
warning: the following explicit lifetimes could be elided: 'syntax_system --> src/edit/syntect.rs:238:6 | 238 | impl<'syntax_system, 'buffer> Edit<'buffer> for SyntaxEditor<'syntax_system, 'buffer> { | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 238 - impl<'syntax_system, 'buffer> Edit<'buffer> for SyntaxEditor<'syntax_system, 'buffer> { 238 + impl<'buffer> Edit<'buffer> for SyntaxEditor<'_, 'buffer> { |
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)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
the following explicit lifetimes could be elided: 'font_system, 'buffer: src/edit/editor.rs#L901
warning: the following explicit lifetimes could be elided: 'font_system, 'buffer --> src/edit/editor.rs:901:6 | 901 | impl<'font_system, 'buffer> BorrowedWithFontSystem<'font_system, Editor<'buffer>> { | ^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 901 - impl<'font_system, 'buffer> BorrowedWithFontSystem<'font_system, Editor<'buffer>> { 901 + impl BorrowedWithFontSystem<'_, Editor<'_>> { |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/edit/editor.rs#L530
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/edit/editor.rs:530:9 | 530 | / match self.change.take() { 531 | | Some(pending) => { 532 | | if !pending.items.is_empty() { 533 | | //TODO: is this a good idea? ... | 539 | | None => {} 540 | | } | |_________^ | = 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 | 530 ~ if let Some(pending) = self.change.take() { 531 + if !pending.items.is_empty() { 532 + //TODO: is this a good idea? 533 + log::warn!("pending change caused apply_change to be ignored!"); 534 + self.change = Some(pending); 535 + return false; 536 + } 537 + } |
this function has too many arguments (8/7): src/edit/editor.rs#L112
warning: this function has too many arguments (8/7) --> src/edit/editor.rs:112:5 | 112 | / pub fn draw<F>( 113 | | &self, 114 | | font_system: &mut FontSystem, 115 | | cache: &mut crate::SwashCache, ... | 120 | | mut f: F, 121 | | ) where | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
item in documentation is missing backticks: src/cursor.rs#L92
warning: item in documentation is missing backticks --> src/cursor.rs:92:63 | 92 | /// Move cursor to next character ([Self::Right] in LTR, [Self::Left] in RTL) | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 92 | /// Move cursor to next character ([Self::Right] in LTR, [`Self::Left`] in RTL) | ~~~~~~~~~~~~
item in documentation is missing backticks: src/cursor.rs#L92
warning: item in documentation is missing backticks --> src/cursor.rs:92:41 | 92 | /// Move cursor to next character ([Self::Right] in LTR, [Self::Left] in RTL) | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 92 | /// Move cursor to next character ([`Self::Right`] in LTR, [Self::Left] in RTL) | ~~~~~~~~~~~~~
item in documentation is missing backticks: src/cursor.rs#L90
warning: item in documentation is missing backticks --> src/cursor.rs:90:66 | 90 | /// Move cursor to previous character ([Self::Left] in LTR, [Self::Right] in RTL) | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 90 | /// Move cursor to previous character ([Self::Left] in LTR, [`Self::Right`] in RTL) | ~~~~~~~~~~~~~
item in documentation is missing backticks: src/cursor.rs#L90
warning: item in documentation is missing backticks --> src/cursor.rs:90:45 | 90 | /// Move cursor to previous character ([Self::Left] in LTR, [Self::Right] in RTL) | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 90 | /// Move cursor to previous character ([`Self::Left`] in LTR, [Self::Right] in RTL) | ~~~~~~~~~~~~
docs for function which may panic missing `# Panics` section: src/cached.rs#L70
warning: docs for function which may panic missing `# Panics` section --> src/cached.rs:70:5 | 70 | pub fn set_unused(&mut self) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/cached.rs:72:34 | 72 | *self = Self::Unused(self.take_used().expect("cached value should be used")); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = 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#L231
warning: docs for function which may panic missing `# Panics` section --> src/buffer_line.rs:231:5 | 231 | / pub fn layout( 232 | | &mut self, 233 | | font_system: &mut FontSystem, 234 | | font_size: f32, ... | 238 | | tab_width: u16, 239 | | ) -> &[LayoutLine] { | |______________________^ | note: first possible panic found here --> src/buffer_line.rs:258:9 | 258 | self.layout_opt.get().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#L206
warning: docs for function which may panic missing `# Panics` section --> src/buffer_line.rs:206:5 | 206 | pub fn shape(&mut self, font_system: &mut FontSystem, tab_width: u16) -> &ShapeLine { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/buffer_line.rs:222:9 | 222 | self.shape_opt.get().expect("shape not found") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
the following explicit lifetimes could be elided: 'a: src/buffer.rs#L1361
warning: the following explicit lifetimes could be elided: 'a --> src/buffer.rs:1361:6 | 1361 | impl<'a> BorrowedWithFontSystem<'a, Buffer> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 1361 - impl<'a> BorrowedWithFontSystem<'a, Buffer> { 1361 + impl BorrowedWithFontSystem<'_, Buffer> { |
usage of a legacy numeric method: src/buffer.rs#L1160
warning: usage of a legacy numeric method --> src/buffer.rs:1160:46 | 1160 | layout_cursor.glyph = usize::max_value(); | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants help: use the associated constant instead | 1160 | layout_cursor.glyph = usize::MAX; | ~~~
usage of a legacy numeric method: src/buffer.rs#L1091
warning: usage of a legacy numeric method --> src/buffer.rs:1091:51 | 1091 | layout_cursor.layout = usize::max_value(); | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants = note: `#[warn(clippy::legacy_numeric_constants)]` on by default help: use the associated constant instead | 1091 | layout_cursor.layout = usize::MAX; | ~~~
docs for function which may panic missing `# Panics` section: src/buffer.rs#L399
warning: docs for function which may panic missing `# Panics` section --> src/buffer.rs:399:5 | 399 | pub fn shape_until_scroll(&mut self, font_system: &mut FontSystem, prune: bool) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/buffer.rs:448:30 | 448 | let layout = self | ______________________________^ 449 | | .line_layout(font_system, line_i) 450 | | .expect("shape_until_scroll invalid line"); | |______________________________________________________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
the loop variable `layout_i` is only used to index `layout`: src/buffer.rs#L326
warning: the loop variable `layout_i` is only used to index `layout` --> src/buffer.rs:326:29 | 326 | for layout_i in 0..layout_cursor.layout { | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop = note: `#[warn(clippy::needless_range_loop)]` on by default help: consider using an iterator | 326 | for <item> in layout.iter().take(layout_cursor.layout) { | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
docs for function which may panic missing `# Panics` section: src/buffer.rs#L308
warning: docs for function which may panic missing `# Panics` section --> src/buffer.rs:308:5 | 308 | / pub fn shape_until_cursor( 309 | | &mut self, 310 | | font_system: &mut FontSystem, 311 | | cursor: Cursor, 312 | | prune: bool, 313 | | ) { | |_____^ | note: first possible panic found here --> src/buffer.rs:317:29 | 317 | let layout_cursor = self | _____________________________^ 318 | | .layout_cursor(font_system, cursor) 319 | | .expect("shape_until_cursor invalid cursor"); | |________________________________________________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
item in documentation is missing backticks: src/buffer.rs#L205
warning: item in documentation is missing backticks --> src/buffer.rs:205:10 | 205 | /// [BufferLine]s (or paragraphs) of text in the buffer | ^^^^^^^^^^ | = 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 | 205 | /// [`BufferLine`]s (or paragraphs) of text in the buffer | ~~~~~~~~~~~~
docs for function which may panic missing `# Panics` section: src/buffer.rs#L40
warning: docs for function which may panic missing `# Panics` section --> src/buffer.rs:40:5 | 40 | pub fn highlight(&self, cursor_start: Cursor, cursor_end: Cursor) -> Option<(f32, f32)> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/buffer.rs:62:25 | 62 | 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
the following explicit lifetimes could be elided: 'a: src/buffer.rs#L35
warning: the following explicit lifetimes could be elided: 'a --> src/buffer.rs:35:6 | 35 | impl<'a> LayoutRun<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 35 - impl<'a> LayoutRun<'a> { 35 + impl LayoutRun<'_> { |
docs for function which may panic missing `# Panics` section: src/attrs.rs#L343
warning: docs for function which may panic missing `# Panics` section --> src/attrs.rs:343:5 | 343 | pub fn split_off(&mut self, index: usize) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/attrs.rs:359:34 | 359 | let (range, attrs) = self | __________________________________^ 360 | | .spans 361 | | .get_key_value(&key.start) 362 | | .map(|v| (v.0.clone(), v.1.clone())) 363 | | .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)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^
this `if` statement can be collapsed: src/buffer.rs#L599
warning: this `if` statement can be collapsed --> src/buffer.rs:599:17 | 599 | / if line.shape_opt().is_some() { 600 | | if line.text().contains('\t') { 601 | | line.reset_shaping(); 602 | | } 603 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if = note: `#[warn(clippy::collapsible_if)]` on by default help: collapse nested if block | 599 ~ if line.shape_opt().is_some() && line.text().contains('\t') { 600 + line.reset_shaping(); 601 + } |
build
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636