Skip to content

Retrofitted to pure Rust #162

Retrofitted to pure Rust

Retrofitted to pure Rust #162

GitHub Actions / clippy failed Nov 12, 2023 in 0s

clippy

16 errors

Details

Results

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

Versions

  • rustc 1.73.0 (cc66ad468 2023-10-03)
  • cargo 1.73.0 (9c4383fb5 2023-08-26)
  • clippy 0.1.73 (cc66ad4 2023-10-03)

Annotations

Check failure on line 62 in src/preview/terminal/ui/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

error: length comparison to zero
  --> src/preview/terminal/ui/mod.rs:62:12
   |
62 |         if families.len() > 0 {
   |            ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!families.is_empty()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
   = note: `#[deny(clippy::len_zero)]` implied by `#[deny(clippy::all)]`

Check failure on line 62 in src/preview/terminal/ui/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

error: length comparison to zero
  --> src/preview/terminal/ui/mod.rs:62:12
   |
62 |         if families.len() > 0 {
   |            ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!families.is_empty()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
   = note: `#[deny(clippy::len_zero)]` implied by `#[deny(clippy::all)]`

Check failure on line 60 in src/preview/browser/builder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `format!` to build up a string from an iterator

error: use of `format!` to build up a string from an iterator
  --> src/preview/browser/builder.rs:50:29
   |
50 |               font_previews = self
   |  _____________________________^
51 | |                 .families
52 | |                 .into_iter()
53 | |                 .map(|family| {
...  |
59 | |                 })
60 | |                 .collect::<String>()
   | |____________________________________^
   |
help: call `fold` instead
  --> src/preview/browser/builder.rs:53:18
   |
53 |                 .map(|family| {
   |                  ^^^
help: ... and use the `write!` macro here
  --> src/preview/browser/builder.rs:54:21
   |
54 | /                     format!(
55 | |                         include_str!("statics/preview_block_template.html"),
56 | |                         char = c,
57 | |                         family = family
58 | |                     )
   | |_____________________^
   = note: this can be written more efficiently by appending to a `String` directly
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
   = note: `#[deny(clippy::format_collect)]` implied by `#[deny(clippy::all)]`

Check failure on line 60 in src/preview/browser/builder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `format!` to build up a string from an iterator

error: use of `format!` to build up a string from an iterator
  --> src/preview/browser/builder.rs:50:29
   |
50 |               font_previews = self
   |  _____________________________^
51 | |                 .families
52 | |                 .into_iter()
53 | |                 .map(|family| {
...  |
59 | |                 })
60 | |                 .collect::<String>()
   | |____________________________________^
   |
help: call `fold` instead
  --> src/preview/browser/builder.rs:53:18
   |
53 |                 .map(|family| {
   |                  ^^^
help: ... and use the `write!` macro here
  --> src/preview/browser/builder.rs:54:21
   |
54 | /                     format!(
55 | |                         include_str!("statics/preview_block_template.html"),
56 | |                         char = c,
57 | |                         family = family
58 | |                     )
   | |_____________________^
   = note: this can be written more efficiently by appending to a `String` directly
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
   = note: `#[deny(clippy::format_collect)]` implied by `#[deny(clippy::all)]`

Check failure on line 43 in src/family.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/family.rs:43:44
   |
43 | pub fn group_by_family_sort_by_name(faces: &Vec<FaceInfo>) -> Vec<Family<'_>> {
   |                                            ^^^^^^^^^^^^^^ help: change this to: `&[FaceInfo]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
   = note: `#[deny(clippy::ptr_arg)]` implied by `#[deny(clippy::all)]`

Check failure on line 59 in src/family.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
  --> src/family.rs:59:5
   |
59 |     return families;
   |     ^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
59 -     return families;
59 +     families
   |

Check failure on line 43 in src/family.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/family.rs:43:44
   |
43 | pub fn group_by_family_sort_by_name(faces: &Vec<FaceInfo>) -> Vec<Family<'_>> {
   |                                            ^^^^^^^^^^^^^^ help: change this to: `&[FaceInfo]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
   = note: `#[deny(clippy::ptr_arg)]` implied by `#[deny(clippy::all)]`

Check failure on line 59 in src/family.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
  --> src/family.rs:59:5
   |
59 |     return families;
   |     ^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
59 -     return families;
59 +     families
   |

Check failure on line 46 in src/loader/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
  --> src/loader/mod.rs:46:13
   |
46 |             return face.transpose();
   |             ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
note: the lint level is defined here
  --> src/main.rs:19:9
   |
19 | #![deny(clippy::all)]
   |         ^^^^^^^^^^^
   = note: `#[deny(clippy::needless_return)]` implied by `#[deny(clippy::all)]`
help: remove `return`
   |
46 -             return face.transpose();
46 +             face.transpose()
   |

Check failure on line 46 in src/loader/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
  --> src/loader/mod.rs:46:13
   |
46 |             return face.transpose();
   |             ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
note: the lint level is defined here
  --> src/main.rs:19:9
   |
19 | #![deny(clippy::all)]
   |         ^^^^^^^^^^^
   = note: `#[deny(clippy::needless_return)]` implied by `#[deny(clippy::all)]`
help: remove `return`
   |
46 -             return face.transpose();
46 +             face.transpose()
   |

Check failure on line 22 in src/rasterizer/font_face.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `face` is never read

error: field `face` is never read
  --> src/rasterizer/font_face.rs:22:5
   |
21 | pub struct FontFace {
   |            -------- field in this struct
22 |     face: owned_ttf_parser::OwnedFace,
   |     ^^^^

Check failure on line 36 in src/rasterizer/bitmap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `new` is never used

error: associated function `new` is never used
  --> src/rasterizer/bitmap.rs:36:19
   |
35 | impl Bitmap {
   | ----------- associated function in this implementation
36 |     pub(super) fn new(_font_face: FontFace) -> Self {
   |                   ^^^

Check failure on line 29 in src/rasterizer/bitmap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

fields `pixel_mode`, `pitch`, and `bitmap` are never read

error: fields `pixel_mode`, `pitch`, and `bitmap` are never read
  --> src/rasterizer/bitmap.rs:29:5
   |
28 | pub struct Bitmap {
   |            ------ fields in this struct
29 |     pixel_mode: u8,
   |     ^^^^^^^^^^
30 |     pitch: u32,
   |     ^^^^^
31 |     metrics: Metrics,
32 |     bitmap: Vec<u8>,
   |     ^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`

Check failure on line 22 in src/rasterizer/font_face.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `face` is never read

error: field `face` is never read
  --> src/rasterizer/font_face.rs:22:5
   |
21 | pub struct FontFace {
   |            -------- field in this struct
22 |     face: owned_ttf_parser::OwnedFace,
   |     ^^^^

Check failure on line 36 in src/rasterizer/bitmap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `new` is never used

error: associated function `new` is never used
  --> src/rasterizer/bitmap.rs:36:19
   |
35 | impl Bitmap {
   | ----------- associated function in this implementation
36 |     pub(super) fn new(_font_face: FontFace) -> Self {
   |                   ^^^

Check failure on line 29 in src/rasterizer/bitmap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

fields `pixel_mode`, `pitch`, and `bitmap` are never read

error: fields `pixel_mode`, `pitch`, and `bitmap` are never read
  --> src/rasterizer/bitmap.rs:29:5
   |
28 | pub struct Bitmap {
   |            ------ fields in this struct
29 |     pixel_mode: u8,
   |     ^^^^^^^^^^
30 |     pitch: u32,
   |     ^^^^^
31 |     metrics: Metrics,
32 |     bitmap: Vec<u8>,
   |     ^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`