Retrofitted to pure Rust #162
Annotations
17 errors and 1 warning
length comparison to zero:
src/preview/terminal/ui/mod.rs#L62
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)]`
|
length comparison to zero:
src/preview/terminal/ui/mod.rs#L62
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)]`
|
use of `format!` to build up a string from an iterator:
src/preview/browser/builder.rs#L50
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)]`
|
use of `format!` to build up a string from an iterator:
src/preview/browser/builder.rs#L50
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)]`
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/family.rs#L43
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)]`
|
unneeded `return` statement:
src/family.rs#L59
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
|
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/family.rs#L43
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)]`
|
unneeded `return` statement:
src/family.rs#L59
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
|
|
unneeded `return` statement:
src/loader/mod.rs#L46
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()
|
|
unneeded `return` statement:
src/loader/mod.rs#L46
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()
|
|
field `face` is never read:
src/rasterizer/font_face.rs#L22
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,
| ^^^^
|
associated function `new` is never used:
src/rasterizer/bitmap.rs#L36
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 {
| ^^^
|
fields `pixel_mode`, `pitch`, and `bitmap` are never read:
src/rasterizer/bitmap.rs#L29
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`
|
field `face` is never read:
src/rasterizer/font_face.rs#L22
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,
| ^^^^
|
associated function `new` is never used:
src/rasterizer/bitmap.rs#L36
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 {
| ^^^
|
fields `pixel_mode`, `pitch`, and `bitmap` are never read:
src/rasterizer/bitmap.rs#L29
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`
|
style
Clippy had exited with the 101 exit code
|
style
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/cargo@v1, 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/
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
fontfor-darwin-arm64
Expired
|
1.95 MB |
|
fontfor-darwin-x64
Expired
|
1.95 MB |
|
fontfor-linux-arm64
Expired
|
6.28 MB |
|
fontfor-linux-armhf
Expired
|
6.28 MB |
|
fontfor-linux-x64
Expired
|
6.28 MB |
|
fontfor-win32-arm64
Expired
|
1.27 MB |
|
fontfor-win32-ia32
Expired
|
1.27 MB |
|
fontfor-win32-x64
Expired
|
1.27 MB |
|