Skip to content

Update swash to 0.2.0 and hook up std feature #257

Update swash to 0.2.0 and hook up std feature

Update swash to 0.2.0 and hook up std feature #257

GitHub Actions / clippy succeeded Jan 6, 2025 in 1s

clippy

54 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 54
Note 0
Help 0

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check warning on line 36 in src/shape_run_cache.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

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`
   |                                                             ~~~~~~~~~~~

Check warning on line 392 in src/shape.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manual saturating arithmetic

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

Check warning on line 389 in src/shape.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manual saturating arithmetic

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

Check warning on line 55 in src/line_ending.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

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

Check warning on line 51 in src/line_ending.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

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<'_> {
   |

Check warning on line 61 in src/layout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

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`]
   |                         ~~~~~~~~~~

Check warning on line 31 in src/layout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

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
   |                 ~~~~~~

Check warning on line 413 in src/font/system.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

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> {
    |

Check warning on line 405 in src/font/system.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

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> {
    |

Check warning on line 109 in src/font/system.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

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`.
    |                           ~~~~~~~~~~~~~~~~~~

Check warning on line 255 in src/font/fallback/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

current MSRV (Minimum Supported Rust Version) is `1.65.0` but this item is stable since `1.66.0`

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

Check warning on line 146 in src/font/fallback/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

current MSRV (Minimum Supported Rust Version) is `1.65.0` but this item is stable since `1.66.0`

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

Check warning on line 143 in src/font/fallback/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

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<'_> {
    |

Check warning on line 337 in src/edit/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'font_system

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> {
    |

Check warning on line 303 in src/edit/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

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`
    |                                                        ~~~~~~~~~~~~

Check warning on line 200 in src/edit/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

consider adding a `;` to the last statement for consistent formatting

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

Check warning on line 96 in src/edit/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'buffer

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<'_> {
   |

Check warning on line 84 in src/edit/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'buffer

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<'_> {
   |

Check warning on line 74 in src/edit/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'buffer

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<'_> {
   |

Check warning on line 1179 in src/edit/vi.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

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

Check warning on line 1170 in src/edit/vi.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'font_system, 'syntax_system, 'buffer

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<'_, '_>>
     |

Check warning on line 1142 in src/edit/vi.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manual implementation of `Option::map`

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 +                                         )))
     |

Check warning on line 1026 in src/edit/vi.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`

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 +                                     }
     |

Check warning on line 998 in src/edit/vi.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`

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 +                                     }
    |

Check warning on line 886 in src/edit/vi.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead

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)
    |