Skip to content

ci: add workflow_dispatch #161

ci: add workflow_dispatch

ci: add workflow_dispatch #161

Triggered via push November 12, 2023 20:11
Status Failure
Total duration 1m 39s
Artifacts 5

ci.yml

on: push
Matrix: build / build
Fit to window
Zoom out
Zoom in

Annotations

86 errors and 1 warning
this argument is a mutable reference, but not used mutably: src/preview/terminal/ui/mod.rs#L62
error: this argument is a mutable reference, but not used mutably --> src/preview/terminal/ui/mod.rs:62:60 | 62 | pub fn new(c: char, families: SortedFamilies<'fc>, ft: &'ft mut FtLibrary) -> Option<Self> { | ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&FtLibrary` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut note: the lint level is defined here --> src/main.rs:20:40 | 20 | #![deny(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^^^^^ = note: `#[deny(clippy::needless_pass_by_ref_mut)]` implied by `#[deny(clippy::nursery)]`
variables can be used directly in the `format!` string: src/main.rs#L85
error: variables can be used directly in the `format!` string --> src/main.rs:85:5 | 85 | println!("Please visit http://{}/ in your browser for preview", addr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 85 - println!("Please visit http://{}/ in your browser for preview", addr); 85 + println!("Please visit http://{addr}/ in your browser for preview"); |
usage of `FromIterator::from_iter`: src/main.rs#L67
error: usage of `FromIterator::from_iter` --> src/main.rs:67:18 | 67 | Some(PreviewServerBuilder::from_iter(families.iter())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `families.iter().collect::<PreviewServerBuilder<_>>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect = note: `#[deny(clippy::from_iter_instead_of_collect)]` implied by `#[deny(clippy::pedantic)]`
variables can be used directly in the `format!` string: src/main.rs#L63
error: variables can be used directly in the `format!` string --> src/main.rs:63:13 | 63 | eprintln!("{:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 63 - eprintln!("{:?}", err); 63 + eprintln!("{err:?}"); |
variables can be used directly in the `format!` string: src/main.rs#L58
error: variables can be used directly in the `format!` string --> src/main.rs:58:13 | 58 | eprintln!("init FreeType failed: {}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 58 - eprintln!("init FreeType failed: {}", e); 58 + eprintln!("init FreeType failed: {e}"); |
matching over `()` is more explicit: src/main.rs#L40
error: matching over `()` is more explicit --> src/main.rs:40:32 | 40 | fc::init().unwrap_or_else(|_| { | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
this expression creates a reference which is immediately dereferenced by the compiler: src/preview/terminal/ui/mod.rs#L350
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/preview/terminal/ui/mod.rs:350:57 | 350 | terminal.draw(|mut f| self.draw(&mut f))?; | ^^^^^^ help: change this to: `f` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
it is more concise to loop over references to containers instead of using explicit iteration methods: src/preview/terminal/ui/mod.rs#L342
error: it is more concise to loop over references to containers instead of using explicit iteration methods --> src/preview/terminal/ui/mod.rs:342:22 | 342 | for event in events.iter() { | ^^^^^^^^^^^^^ help: to write this more concisely, try: `&*events` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
this expression creates a reference which is immediately dereferenced by the compiler: src/preview/terminal/ui/mod.rs#L340
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/preview/terminal/ui/mod.rs:340:41 | 340 | terminal.draw(|mut f| self.draw(&mut f))?; | ^^^^^^ help: change this to: `f` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
this argument is a mutable reference, but not used mutably: src/preview/terminal/ui/mod.rs#L62
error: this argument is a mutable reference, but not used mutably --> src/preview/terminal/ui/mod.rs:62:60 | 62 | pub fn new(c: char, families: SortedFamilies<'fc>, ft: &'ft mut FtLibrary) -> Option<Self> { | ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&FtLibrary` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut note: the lint level is defined here --> src/main.rs:20:40 | 20 | #![deny(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^^^^^ = note: `#[deny(clippy::needless_pass_by_ref_mut)]` implied by `#[deny(clippy::nursery)]`
variables can be used directly in the `format!` string: src/main.rs#L85
error: variables can be used directly in the `format!` string --> src/main.rs:85:5 | 85 | println!("Please visit http://{}/ in your browser for preview", addr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 85 - println!("Please visit http://{}/ in your browser for preview", addr); 85 + println!("Please visit http://{addr}/ in your browser for preview"); |
usage of `FromIterator::from_iter`: src/main.rs#L67
error: usage of `FromIterator::from_iter` --> src/main.rs:67:18 | 67 | Some(PreviewServerBuilder::from_iter(families.iter())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `families.iter().collect::<PreviewServerBuilder<_>>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect = note: `#[deny(clippy::from_iter_instead_of_collect)]` implied by `#[deny(clippy::pedantic)]`
variables can be used directly in the `format!` string: src/main.rs#L63
error: variables can be used directly in the `format!` string --> src/main.rs:63:13 | 63 | eprintln!("{:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 63 - eprintln!("{:?}", err); 63 + eprintln!("{err:?}"); |
variables can be used directly in the `format!` string: src/main.rs#L58
error: variables can be used directly in the `format!` string --> src/main.rs:58:13 | 58 | eprintln!("init FreeType failed: {}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 58 - eprintln!("init FreeType failed: {}", e); 58 + eprintln!("init FreeType failed: {e}"); |
matching over `()` is more explicit: src/main.rs#L40
error: matching over `()` is more explicit --> src/main.rs:40:32 | 40 | fc::init().unwrap_or_else(|_| { | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
this expression creates a reference which is immediately dereferenced by the compiler: src/preview/terminal/ui/mod.rs#L350
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/preview/terminal/ui/mod.rs:350:57 | 350 | terminal.draw(|mut f| self.draw(&mut f))?; | ^^^^^^ help: change this to: `f` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
it is more concise to loop over references to containers instead of using explicit iteration methods: src/preview/terminal/ui/mod.rs#L342
error: it is more concise to loop over references to containers instead of using explicit iteration methods --> src/preview/terminal/ui/mod.rs:342:22 | 342 | for event in events.iter() { | ^^^^^^^^^^^^^ help: to write this more concisely, try: `&*events` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
this expression creates a reference which is immediately dereferenced by the compiler: src/preview/terminal/ui/mod.rs#L340
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/preview/terminal/ui/mod.rs:340:41 | 340 | terminal.draw(|mut f| self.draw(&mut f))?; | ^^^^^^ help: change this to: `f` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
explicit `deref_mut` method call: src/preview/terminal/ui/mod.rs#L82
error: explicit `deref_mut` method call --> src/preview/terminal/ui/mod.rs:82:46 | 82 | f.render_stateful_widget(list, area, self.state.mut_list_state().deref_mut()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *self.state.mut_list_state()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods = note: `#[deny(clippy::explicit_deref_methods)]` implied by `#[deny(clippy::pedantic)]`
consider adding a `;` to the last statement for consistent formatting: src/preview/terminal/ui/mod.rs#L82
error: consider adding a `;` to the last statement for consistent formatting --> src/preview/terminal/ui/mod.rs:82:9 | 82 | f.render_stateful_widget(list, area, self.state.mut_list_state().deref_mut()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `f.render_stateful_widget(list, area, self.state.mut_list_state().deref_mut());` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned = note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]`
matching over `()` is more explicit: src/preview/terminal/ui/state.rs#L144
error: matching over `()` is more explicit --> src/preview/terminal/ui/state.rs:144:19 | 144 | .map(|_| font_face) | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
matching over `()` is more explicit: src/preview/terminal/ui/state.rs#L120
error: matching over `()` is more explicit --> src/preview/terminal/ui/state.rs:120:23 | 120 | .or_else(|_| { | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
explicit `deref_mut` method call: src/preview/terminal/ui/mod.rs#L82
error: explicit `deref_mut` method call --> src/preview/terminal/ui/mod.rs:82:46 | 82 | f.render_stateful_widget(list, area, self.state.mut_list_state().deref_mut()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut *self.state.mut_list_state()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods = note: `#[deny(clippy::explicit_deref_methods)]` implied by `#[deny(clippy::pedantic)]`
consider adding a `;` to the last statement for consistent formatting: src/preview/terminal/ui/mod.rs#L82
error: consider adding a `;` to the last statement for consistent formatting --> src/preview/terminal/ui/mod.rs:82:9 | 82 | f.render_stateful_widget(list, area, self.state.mut_list_state().deref_mut()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `f.render_stateful_widget(list, area, self.state.mut_list_state().deref_mut());` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned = note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]`
`Box::new(_)` of default value: src/preview/terminal/ui/state.rs#L50
error: `Box::new(_)` of default value --> src/preview/terminal/ui/state.rs:50:42 | 50 | renders.insert(RenderType::Mono, Box::new(MonoRender::default())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<MonoRender>::default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_default = note: `#[deny(clippy::box_default)]` implied by `#[deny(clippy::all)]`
matching over `()` is more explicit: src/preview/terminal/ui/state.rs#L144
error: matching over `()` is more explicit --> src/preview/terminal/ui/state.rs:144:19 | 144 | .map(|_| font_face) | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
matching over `()` is more explicit: src/preview/terminal/ui/state.rs#L120
error: matching over `()` is more explicit --> src/preview/terminal/ui/state.rs:120:23 | 120 | .or_else(|_| { | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
casting to the same type is unnecessary (`usize` -> `usize`): src/preview/terminal/ui/canvas_render.rs#L96
error: casting to the same type is unnecessary (`usize` -> `usize`) --> src/preview/terminal/ui/canvas_render.rs:96:43 | 96 | painter.paint(x as usize, y as usize, Color::Reset); | ^^^^^^^^^^ help: try: `y` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
casting to the same type is unnecessary (`usize` -> `usize`): src/preview/terminal/ui/canvas_render.rs#L96
error: casting to the same type is unnecessary (`usize` -> `usize`) --> src/preview/terminal/ui/canvas_render.rs:96:31 | 96 | painter.paint(x as usize, y as usize, Color::Reset); | ^^^^^^^^^^ help: try: `x` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[deny(clippy::unnecessary_cast)]` implied by `#[deny(clippy::all)]`
`Box::new(_)` of default value: src/preview/terminal/ui/state.rs#L50
error: `Box::new(_)` of default value --> src/preview/terminal/ui/state.rs:50:42 | 50 | renders.insert(RenderType::Mono, Box::new(MonoRender::default())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<MonoRender>::default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_default = note: `#[deny(clippy::box_default)]` implied by `#[deny(clippy::all)]`
it is more concise to loop over references to containers instead of using explicit iteration methods: src/preview/terminal/render/mod.rs#L40
error: it is more concise to loop over references to containers instead of using explicit iteration methods --> src/preview/terminal/render/mod.rs:40:22 | 40 | for c in line.iter() { | ^^^^^^^^^^^ help: to write this more concisely, try: `line` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop = note: `#[deny(clippy::explicit_iter_loop)]` implied by `#[deny(clippy::pedantic)]`
this `impl` can be derived: src/preview/terminal/render/mono.rs#L23
error: this `impl` can be derived --> src/preview/terminal/render/mono.rs:23:1 | 23 | / impl Default for MonoRender { 24 | | fn default() -> Self { 25 | | Self {} 26 | | } 27 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = help: remove the manual implementation... help: ...and instead derive it | 21 + #[derive(Default)] 22 | pub struct MonoRender {} |
casting to the same type is unnecessary (`usize` -> `usize`): src/preview/terminal/ui/canvas_render.rs#L96
error: casting to the same type is unnecessary (`usize` -> `usize`) --> src/preview/terminal/ui/canvas_render.rs:96:43 | 96 | painter.paint(x as usize, y as usize, Color::Reset); | ^^^^^^^^^^ help: try: `y` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
casting to the same type is unnecessary (`usize` -> `usize`): src/preview/terminal/ui/canvas_render.rs#L96
error: casting to the same type is unnecessary (`usize` -> `usize`) --> src/preview/terminal/ui/canvas_render.rs:96:31 | 96 | painter.paint(x as usize, y as usize, Color::Reset); | ^^^^^^^^^^ help: try: `x` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[deny(clippy::unnecessary_cast)]` implied by `#[deny(clippy::all)]`
variables can be used directly in the `format!` string: src/preview/browser/server.rs#L204
error: variables can be used directly in the `format!` string --> src/preview/browser/server.rs:204:25 | 204 | eprintln!("Error when process request: {:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 204 - eprintln!("Error when process request: {:?}", err); 204 + eprintln!("Error when process request: {err:?}"); |
variables can be used directly in the `format!` string: src/preview/browser/server.rs#L189
error: variables can be used directly in the `format!` string --> src/preview/browser/server.rs:189:13 | 189 | eprintln!("Error when start http server: {:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 189 - eprintln!("Error when start http server: {:?}", err); 189 + eprintln!("Error when start http server: {err:?}"); |
it is more concise to loop over references to containers instead of using explicit iteration methods: src/preview/terminal/render/mod.rs#L40
error: it is more concise to loop over references to containers instead of using explicit iteration methods --> src/preview/terminal/render/mod.rs:40:22 | 40 | for c in line.iter() { | ^^^^^^^^^^^ help: to write this more concisely, try: `line` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop = note: `#[deny(clippy::explicit_iter_loop)]` implied by `#[deny(clippy::pedantic)]`
this `impl` can be derived: src/preview/terminal/render/mono.rs#L23
error: this `impl` can be derived --> src/preview/terminal/render/mono.rs:23:1 | 23 | / impl Default for MonoRender { 24 | | fn default() -> Self { 25 | | Self {} 26 | | } 27 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = help: remove the manual implementation... help: ...and instead derive it | 21 + #[derive(Default)] 22 | pub struct MonoRender {} |
matching over `()` is more explicit: src/preview/browser/server.rs#L139
error: matching over `()` is more explicit --> src/preview/browser/server.rs:139:36 | 139 | ... Ok(_) | Err(TryRecvError::Disconnected) => return Ok(false), | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns = note: `#[deny(clippy::ignored_unit_patterns)]` implied by `#[deny(clippy::pedantic)]`
variables can be used directly in the `format!` string: src/preview/browser/server.rs#L204
error: variables can be used directly in the `format!` string --> src/preview/browser/server.rs:204:25 | 204 | eprintln!("Error when process request: {:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 204 - eprintln!("Error when process request: {:?}", err); 204 + eprintln!("Error when process request: {err:?}"); |
variables can be used directly in the `format!` string: src/preview/browser/server.rs#L189
error: variables can be used directly in the `format!` string --> src/preview/browser/server.rs:189:13 | 189 | eprintln!("Error when start http server: {:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 189 - eprintln!("Error when start http server: {:?}", err); 189 + eprintln!("Error when start http server: {err:?}"); |
variables can be used directly in the `format!` string: src/preview/browser/server.rs#L56
error: variables can be used directly in the `format!` string --> src/preview/browser/server.rs:56:9 | 56 | format!("HTTP/1.1 {} {}\r\n", code, reason) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 56 - format!("HTTP/1.1 {} {}\r\n", code, reason) 56 + format!("HTTP/1.1 {code} {reason}\r\n") |
matching over `()` is more explicit: src/preview/browser/server.rs#L139
error: matching over `()` is more explicit --> src/preview/browser/server.rs:139:36 | 139 | ... Ok(_) | Err(TryRecvError::Disconnected) => return Ok(false), | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns = note: `#[deny(clippy::ignored_unit_patterns)]` implied by `#[deny(clippy::pedantic)]`
variables can be used directly in the `format!` string: src/preview/browser/server.rs#L56
error: variables can be used directly in the `format!` string --> src/preview/browser/server.rs:56:9 | 56 | format!("HTTP/1.1 {} {}\r\n", code, reason) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 56 - format!("HTTP/1.1 {} {}\r\n", code, reason) 56 + format!("HTTP/1.1 {code} {reason}\r\n") |
use of `format!` to build up a string from an iterator: src/preview/browser/builder.rs#L56
error: use of `format!` to build up a string from an iterator --> src/preview/browser/builder.rs:56:29 | 56 | font_previews = self | _____________________________^ 57 | | .families 58 | | .into_iter() 59 | | .map(|family| { ... | 65 | | }) 66 | | .collect::<String>() | |____________________________________^ | help: call `fold` instead --> src/preview/browser/builder.rs:59:18 | 59 | .map(|family| { | ^^^ help: ... and use the `write!` macro here --> src/preview/browser/builder.rs:60:21 | 60 | / format!( 61 | | include_str!("statics/preview_block_template.html"), 62 | | char = c, 63 | | family = family 64 | | ) | |_____________________^ = 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)]`
this `impl` can be derived: src/preview/browser/builder.rs#L29
error: this `impl` can be derived --> src/preview/browser/builder.rs:29:1 | 29 | / impl<'a> Default for Builder<'a> { 30 | | fn default() -> Self { 31 | | Self { families: vec![] } 32 | | } 33 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = note: `#[deny(clippy::derivable_impls)]` implied by `#[deny(clippy::all)]` = help: remove the manual implementation... help: ...and instead derive it | 25 + #[derive(Default)] 26 | pub struct Builder<'a> { |
use of `format!` to build up a string from an iterator: src/preview/browser/builder.rs#L56
error: use of `format!` to build up a string from an iterator --> src/preview/browser/builder.rs:56:29 | 56 | font_previews = self | _____________________________^ 57 | | .families 58 | | .into_iter() 59 | | .map(|family| { ... | 65 | | }) 66 | | .collect::<String>() | |____________________________________^ | help: call `fold` instead --> src/preview/browser/builder.rs:59:18 | 59 | .map(|family| { | ^^^ help: ... and use the `write!` macro here --> src/preview/browser/builder.rs:60:21 | 60 | / format!( 61 | | include_str!("statics/preview_block_template.html"), 62 | | char = c, 63 | | family = family 64 | | ) | |_____________________^ = 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)]`
this `impl` can be derived: src/preview/browser/builder.rs#L29
error: this `impl` can be derived --> src/preview/browser/builder.rs:29:1 | 29 | / impl<'a> Default for Builder<'a> { 30 | | fn default() -> Self { 31 | | Self { families: vec![] } 32 | | } 33 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = note: `#[deny(clippy::derivable_impls)]` implied by `#[deny(clippy::all)]` = help: remove the manual implementation... help: ...and instead derive it | 25 + #[derive(Default)] 26 | pub struct Builder<'a> { |
variables can be used directly in the `format!` string: src/one_char.rs#L60
error: variables can be used directly in the `format!` string --> src/one_char.rs:60:17 | 60 | format!("has invalid char when parse as a base {} number", radix) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 60 - format!("has invalid char when parse as a base {} number", radix) 60 + format!("has invalid char when parse as a base {radix} number") |
variables can be used directly in the `format!` string: src/one_char.rs#L57
error: variables can be used directly in the `format!` string --> src/one_char.rs:57:17 | 57 | format!("invalid unicode scalar value {}", scalar_value) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 57 - format!("invalid unicode scalar value {}", scalar_value) 57 + format!("invalid unicode scalar value {scalar_value}") |
variables can be used directly in the `format!` string: src/one_char.rs#L60
error: variables can be used directly in the `format!` string --> src/one_char.rs:60:17 | 60 | format!("has invalid char when parse as a base {} number", radix) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 60 - format!("has invalid char when parse as a base {} number", radix) 60 + format!("has invalid char when parse as a base {radix} number") |
variables can be used directly in the `format!` string: src/one_char.rs#L57
error: variables can be used directly in the `format!` string --> src/one_char.rs:57:17 | 57 | format!("invalid unicode scalar value {}", scalar_value) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 57 - format!("invalid unicode scalar value {}", scalar_value) 57 + format!("invalid unicode scalar value {scalar_value}") |
variables can be used directly in the `format!` string: src/one_char.rs#L29
error: variables can be used directly in the `format!` string --> src/one_char.rs:29:44 | 29 | let bytes = utf8.iter().map(|byte| format!("0x{:X}", byte)).collect::<Vec<_>>(); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[deny(clippy::uninlined_format_args)]` implied by `#[deny(clippy::pedantic)]` help: change this to | 29 - let bytes = utf8.iter().map(|byte| format!("0x{:X}", byte)).collect::<Vec<_>>(); 29 + let bytes = utf8.iter().map(|byte| format!("0x{byte:X}")).collect::<Vec<_>>(); |
variables can be used directly in the `format!` string: src/one_char.rs#L29
error: variables can be used directly in the `format!` string --> src/one_char.rs:29:44 | 29 | let bytes = utf8.iter().map(|byte| format!("0x{:X}", byte)).collect::<Vec<_>>(); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[deny(clippy::uninlined_format_args)]` implied by `#[deny(clippy::pedantic)]` help: change this to | 29 - let bytes = utf8.iter().map(|byte| format!("0x{:X}", byte)).collect::<Vec<_>>(); 29 + let bytes = utf8.iter().map(|byte| format!("0x{byte:X}")).collect::<Vec<_>>(); |
borrow as raw pointer: src/ft/library.rs#L32
error: borrow as raw pointer --> src/ft/library.rs:32:49 | 32 | let ret = unsafe { ft::FT_Init_FreeType(&mut library as *mut ft::FT_Library) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(library)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
borrow as raw pointer: src/ft/font_face.rs#L63
error: borrow as raw pointer --> src/ft/font_face.rs:63:59 | 63 | let ret = unsafe { ft::FT_Request_Size(self.face, &mut request as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(request)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
borrow as raw pointer: src/ft/library.rs#L32
error: borrow as raw pointer --> src/ft/library.rs:32:49 | 32 | let ret = unsafe { ft::FT_Init_FreeType(&mut library as *mut ft::FT_Library) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(library)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
borrow as raw pointer: src/ft/font_face.rs#L45
error: borrow as raw pointer --> src/ft/font_face.rs:45:17 | 45 | &mut face as *mut ft::FT_Face, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(face)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
borrow as raw pointer: src/ft/font_face.rs#L63
error: borrow as raw pointer --> src/ft/font_face.rs:63:59 | 63 | let ret = unsafe { ft::FT_Request_Size(self.face, &mut request as *mut _) }; | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(request)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
borrow as raw pointer: src/ft/font_face.rs#L45
error: borrow as raw pointer --> src/ft/font_face.rs:45:17 | 45 | &mut face as *mut ft::FT_Face, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(face)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
casting the result of `i32::abs()` to u32: src/ft/bitmap.rs#L45
error: casting the result of `i32::abs()` to u32 --> src/ft/bitmap.rs:45:21 | 45 | let pitch = glyph.bitmap.pitch.abs() as u32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `glyph.bitmap.pitch.unsigned_abs()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned = note: `#[deny(clippy::cast_abs_to_unsigned)]` implied by `#[deny(clippy::all)]`
iterating on a map's values: src/font.rs#L146
error: iterating on a map's values --> src/font.rs:146:13 | 146 | families.into_iter().map(|(_, family)| family).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `families.into_values()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map = note: `#[deny(clippy::iter_kv_map)]` implied by `#[deny(clippy::all)]`
casting the result of `i32::abs()` to u32: src/ft/bitmap.rs#L45
error: casting the result of `i32::abs()` to u32 --> src/ft/bitmap.rs:45:21 | 45 | let pitch = glyph.bitmap.pitch.abs() as u32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `glyph.bitmap.pitch.unsigned_abs()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned = note: `#[deny(clippy::cast_abs_to_unsigned)]` implied by `#[deny(clippy::all)]`
iterating on a map's values: src/font.rs#L146
error: iterating on a map's values --> src/font.rs:146:13 | 146 | families.into_iter().map(|(_, family)| family).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `families.into_values()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map = note: `#[deny(clippy::iter_kv_map)]` implied by `#[deny(clippy::all)]`
`as` casting between raw pointers without changing its mutability: src/fc/pattern.rs#L74
error: `as` casting between raw pointers without changing its mutability --> src/fc/pattern.rs:74:49 | 74 | let s = unsafe { ffi::CString::from_raw(s as *mut c_char) }; | ^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `s.cast::<c_char>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
`as` casting between raw pointers without changing its mutability: src/fc/pattern.rs#L74
error: `as` casting between raw pointers without changing its mutability --> src/fc/pattern.rs:74:49 | 74 | let s = unsafe { ffi::CString::from_raw(s as *mut c_char) }; | ^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `s.cast::<c_char>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
`as` casting between raw pointers without changing its mutability: src/fc/pattern.rs#L53
error: `as` casting between raw pointers without changing its mutability --> src/fc/pattern.rs:53:48 | 53 | let pattern = unsafe { fc::FcNameParse(c_pattern.as_ptr() as *const fc::FcChar8) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `c_pattern.as_ptr().cast::<fc::FcChar8>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
`as` casting between raw pointers without changing its mutability: src/fc/pattern.rs#L53
error: `as` casting between raw pointers without changing its mutability --> src/fc/pattern.rs:53:48 | 53 | let pattern = unsafe { fc::FcNameParse(c_pattern.as_ptr() as *const fc::FcChar8) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `c_pattern.as_ptr().cast::<fc::FcChar8>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
borrow as raw pointer: src/fc/font_info.rs#L95
error: borrow as raw pointer --> src/fc/font_info.rs:95:71 | 95 | fc::FcPatternGetInteger(self.ptr, c_name.as_ptr(), n, &mut value as *mut c_int) | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(value)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
borrow as raw pointer: src/fc/font_info.rs#L95
error: borrow as raw pointer --> src/fc/font_info.rs:95:71 | 95 | fc::FcPatternGetInteger(self.ptr, c_name.as_ptr(), n, &mut value as *mut c_int) | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(value)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
use of `or_insert_with` to construct default value: src/fc/font_info.rs#L79
error: use of `or_insert_with` to construct default value --> src/fc/font_info.rs:79:22 | 79 | .or_insert_with(Vec::new) | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[deny(clippy::unwrap_or_default)]` implied by `#[deny(clippy::all)]`
use of `or_insert_with` to construct default value: src/fc/font_info.rs#L79
error: use of `or_insert_with` to construct default value --> src/fc/font_info.rs:79:22 | 79 | .or_insert_with(Vec::new) | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[deny(clippy::unwrap_or_default)]` implied by `#[deny(clippy::all)]`
explicit call to `.into_iter()` in function argument accepting `IntoIterator`: src/fc/font_info.rs#L77
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> src/fc/font_info.rs:77:39 | 77 | languages.into_iter().zip(values.into_iter()).for_each(|(lang, value)| { | ^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `values` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/iter/traits/iterator.rs:642:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion note: the lint level is defined here --> src/main.rs:20:9 | 20 | #![deny(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^ = note: `#[deny(clippy::useless_conversion)]` implied by `#[deny(clippy::all)]`
explicit call to `.into_iter()` in function argument accepting `IntoIterator`: src/fc/font_info.rs#L77
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> src/fc/font_info.rs:77:39 | 77 | languages.into_iter().zip(values.into_iter()).for_each(|(lang, value)| { | ^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `values` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/iter/traits/iterator.rs:642:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion note: the lint level is defined here --> src/main.rs:20:9 | 20 | #![deny(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^ = note: `#[deny(clippy::useless_conversion)]` implied by `#[deny(clippy::all)]`
`as` casting between raw pointers without changing its mutability: src/fc/font_info.rs#L55
error: `as` casting between raw pointers without changing its mutability --> src/fc/font_info.rs:55:57 | 55 | let value_str = unsafe { CStr::from_ptr(value as *mut c_char) }; | ^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `value.cast::<c_char>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr = note: `#[deny(clippy::ptr_as_ptr)]` implied by `#[deny(clippy::pedantic)]`
`as` casting between raw pointers without changing its mutability: src/fc/font_info.rs#L55
error: `as` casting between raw pointers without changing its mutability --> src/fc/font_info.rs:55:57 | 55 | let value_str = unsafe { CStr::from_ptr(value as *mut c_char) }; | ^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `value.cast::<c_char>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr = note: `#[deny(clippy::ptr_as_ptr)]` implied by `#[deny(clippy::pedantic)]`
borrow as raw pointer: src/fc/font_info.rs#L52
error: borrow as raw pointer --> src/fc/font_info.rs:52:70 | 52 | fc::FcPatternGetString(self.ptr, c_name.as_ptr(), n, &mut value as *mut *mut u8) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(value)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr = note: `#[deny(clippy::borrow_as_ptr)]` implied by `#[deny(clippy::pedantic)]`
borrow as raw pointer: src/fc/font_info.rs#L52
error: borrow as raw pointer --> src/fc/font_info.rs:52:70 | 52 | fc::FcPatternGetString(self.ptr, c_name.as_ptr(), n, &mut value as *mut *mut u8) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of_mut!(value)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr = note: `#[deny(clippy::borrow_as_ptr)]` implied by `#[deny(clippy::pedantic)]`
redundant else block: src/preview/browser/server.rs#L142
error: redundant else block --> src/preview/browser/server.rs:142:32 | 142 | } else { | ________________________________^ 143 | | return Err(err); 144 | | } | |_________________________^ | = help: remove the `else` block and move the contents out = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else note: the lint level is defined here --> src/main.rs:20:22 | 20 | #![deny(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::redundant_else)]` implied by `#[deny(clippy::pedantic)]`
redundant else block: src/preview/browser/server.rs#L142
error: redundant else block --> src/preview/browser/server.rs:142:32 | 142 | } else { | ________________________________^ 143 | | return Err(err); 144 | | } | |_________________________^ | = help: remove the `else` block and move the contents out = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else note: the lint level is defined here --> src/main.rs:20:22 | 20 | #![deny(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::redundant_else)]` implied by `#[deny(clippy::pedantic)]`
style
Clippy had exited with the 101 exit code
build / Build for win32-ia32
Process completed with exit code 1.
build / Build for win32-x64
The job was canceled because "windows-latest_i686-pc-wi" failed.
build / Build for win32-x64
The operation was canceled.
build / Build for win32-arm64
The job was canceled because "windows-latest_i686-pc-wi" failed.
build / Build for win32-arm64
The operation was canceled.
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.76 MB
fontfor-darwin-x64 Expired
1.76 MB
fontfor-linux-arm64 Expired
5.79 MB
fontfor-linux-armhf Expired
5.79 MB
fontfor-linux-x64 Expired
5.79 MB