set proper font name font size (#56) #155
clippy
80 errors
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 80 |
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
github-actions / clippy
this argument is a mutable reference, but not used mutably
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)]`
Check failure on line 85 in src/main.rs
github-actions / clippy
variables can be used directly in the `format!` string
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");
|
Check failure on line 67 in src/main.rs
github-actions / clippy
usage of `FromIterator::from_iter`
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)]`
Check failure on line 63 in src/main.rs
github-actions / clippy
variables can be used directly in the `format!` string
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:?}");
|
Check failure on line 58 in src/main.rs
github-actions / clippy
variables can be used directly in the `format!` string
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}");
|
Check failure on line 40 in src/main.rs
github-actions / clippy
matching over `()` is more explicit
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
Check failure on line 350 in src/preview/terminal/ui/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
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
Check failure on line 342 in src/preview/terminal/ui/mod.rs
github-actions / clippy
it is more concise to loop over references to containers instead of using explicit iteration methods
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
Check failure on line 340 in src/preview/terminal/ui/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
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)]`
Check failure on line 62 in src/preview/terminal/ui/mod.rs
github-actions / clippy
this argument is a mutable reference, but not used mutably
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)]`
Check failure on line 85 in src/main.rs
github-actions / clippy
variables can be used directly in the `format!` string
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");
|
Check failure on line 67 in src/main.rs
github-actions / clippy
usage of `FromIterator::from_iter`
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)]`
Check failure on line 63 in src/main.rs
github-actions / clippy
variables can be used directly in the `format!` string
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:?}");
|
Check failure on line 58 in src/main.rs
github-actions / clippy
variables can be used directly in the `format!` string
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}");
|
Check failure on line 40 in src/main.rs
github-actions / clippy
matching over `()` is more explicit
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
Check failure on line 350 in src/preview/terminal/ui/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
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
Check failure on line 342 in src/preview/terminal/ui/mod.rs
github-actions / clippy
it is more concise to loop over references to containers instead of using explicit iteration methods
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
Check failure on line 340 in src/preview/terminal/ui/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
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)]`
Check failure on line 82 in src/preview/terminal/ui/mod.rs
github-actions / clippy
explicit `deref_mut` method call
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)]`
Check failure on line 82 in src/preview/terminal/ui/mod.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
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)]`
Check failure on line 144 in src/preview/terminal/ui/state.rs
github-actions / clippy
matching over `()` is more explicit
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
Check failure on line 120 in src/preview/terminal/ui/state.rs
github-actions / clippy
matching over `()` is more explicit
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
Check failure on line 82 in src/preview/terminal/ui/mod.rs
github-actions / clippy
explicit `deref_mut` method call
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)]`
Check failure on line 82 in src/preview/terminal/ui/mod.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
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)]`
Check failure on line 50 in src/preview/terminal/ui/state.rs
github-actions / clippy
`Box::new(_)` of default value
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)]`