Skip to content

Quick fixes for eg-font-converter's generated BdfFonts (#34) #36

Quick fixes for eg-font-converter's generated BdfFonts (#34)

Quick fixes for eg-font-converter's generated BdfFonts (#34) #36

GitHub Actions / clippy succeeded Dec 18, 2024 in 0s

clippy

19 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 19
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 524 in eg-font-converter/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> eg-font-converter/src/lib.rs:512:1
    |
512 | / impl ToString for Visibility {
513 | |     fn to_string(&self) -> String {
514 | |         match self {
515 | |             Visibility::Private => "",
...   |
523 | |     }
524 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
    = note: `#[warn(clippy::to_string_trait_impl)]` on by default

Check warning on line 436 in eg-font-converter/src/lib.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
   --> eg-font-converter/src/lib.rs:436:31
    |
436 |         output_directory.join(&self.data_file())
    |                               ^^^^^^^^^^^^^^^^^ help: change this to: `self.data_file()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 273 in eg-font-converter/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

warning: useless use of `format!`
   --> eg-font-converter/src/lib.rs:273:60
    |
273 |                 ParserBdfFont::parse(data).with_context(|| format!("couldn't parse BDF file"))?
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"couldn't parse BDF file".to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format

Check warning on line 270 in eg-font-converter/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

warning: useless use of `format!`
   --> eg-font-converter/src/lib.rs:270:61
    |
270 |                 ParserBdfFont::parse(&data).with_context(|| format!("couldn't parse BDF file"))?
    |                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"couldn't parse BDF file".to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
    = note: `#[warn(clippy::useless_format)]` on by default

Check warning on line 193 in eg-font-converter/src/mono_font.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
   --> eg-font-converter/src/mono_font.rs:193:63
    |
193 |         fs::write(self.font.data_file_path(output_directory), &self.data())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.data()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 192 in eg-font-converter/src/mono_font.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
   --> eg-font-converter/src/mono_font.rs:192:63
    |
192 |         fs::write(self.font.rust_file_path(output_directory), &self.rust())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.rust()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 41 in eg-font-converter/src/mono_font.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manually reimplementing `div_ceil`

warning: manually reimplementing `div_ceil`
  --> eg-font-converter/src/mono_font.rs:41:20
   |
41 |         let rows = (font.glyphs.len() + (glyphs_per_row - 1)) / glyphs_per_row;
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `font.glyphs.len().div_ceil(glyphs_per_row)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
   = note: `#[warn(clippy::manual_div_ceil)]` on by default

Check warning on line 142 in eg-font-converter/src/eg_bdf_font.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
   --> eg-font-converter/src/eg_bdf_font.rs:142:63
    |
142 |         fs::write(self.font.data_file_path(output_directory), &self.data())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.data()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 141 in eg-font-converter/src/eg_bdf_font.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
   --> eg-font-converter/src/eg_bdf_font.rs:141:63
    |
141 |         fs::write(self.font.rust_file_path(output_directory), &self.rust())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.rust()`
    |
    = 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 29 in eg-font-converter/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

needless `fn main` in doctest

warning: needless `fn main` in doctest
  --> eg-font-converter/src/lib.rs:18:5
   |
18 |   //! use eg_font_converter::{FontConverter, Mapping};
   |  _____^
19 | | //!
20 | | //! fn main() {
21 | | //!     let out_dir = std::env::var_os("OUT_DIR").unwrap();
...  |
28 | | //!      font_6x10.save(&out_dir).unwrap();
29 | | //! }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
   = note: `#[warn(clippy::needless_doctest_main)]` on by default

Check warning on line 524 in eg-font-converter/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> eg-font-converter/src/lib.rs:512:1
    |
512 | / impl ToString for Visibility {
513 | |     fn to_string(&self) -> String {
514 | |         match self {
515 | |             Visibility::Private => "",
...   |
523 | |     }
524 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
    = note: `#[warn(clippy::to_string_trait_impl)]` on by default

Check warning on line 193 in eg-font-converter/src/mono_font.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
   --> eg-font-converter/src/mono_font.rs:193:63
    |
193 |         fs::write(self.font.data_file_path(output_directory), &self.data())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.data()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 160 in bdf-parser/src/properties.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `unwrap_or_else` to construct default value

warning: use of `unwrap_or_else` to construct default value
   --> bdf-parser/src/properties.rs:160:22
    |
160 |                     .unwrap_or_else(HashMap::new);
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default

Check warning on line 192 in eg-font-converter/src/mono_font.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
   --> eg-font-converter/src/mono_font.rs:192:63
    |
192 |         fs::write(self.font.rust_file_path(output_directory), &self.rust())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.rust()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 41 in eg-font-converter/src/mono_font.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manually reimplementing `div_ceil`

warning: manually reimplementing `div_ceil`
  --> eg-font-converter/src/mono_font.rs:41:20
   |
41 |         let rows = (font.glyphs.len() + (glyphs_per_row - 1)) / glyphs_per_row;
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `font.glyphs.len().div_ceil(glyphs_per_row)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
   = note: `#[warn(clippy::manual_div_ceil)]` on by default

Check warning on line 142 in eg-font-converter/src/eg_bdf_font.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
   --> eg-font-converter/src/eg_bdf_font.rs:142:63
    |
142 |         fs::write(self.font.data_file_path(output_directory), &self.data())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.data()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 141 in eg-font-converter/src/eg_bdf_font.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
   --> eg-font-converter/src/eg_bdf_font.rs:141:63
    |
141 |         fs::write(self.font.rust_file_path(output_directory), &self.rust())?;
    |                                                               ^^^^^^^^^^^^ help: change this to: `self.rust()`
    |
    = 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 29 in eg-font-converter/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

needless `fn main` in doctest

warning: needless `fn main` in doctest
  --> eg-font-converter/src/lib.rs:18:5
   |
18 |   //! use eg_font_converter::{FontConverter, Mapping};
   |  _____^
19 | | //!
20 | | //! fn main() {
21 | | //!     let out_dir = std::env::var_os("OUT_DIR").unwrap();
...  |
28 | | //!      font_6x10.save(&out_dir).unwrap();
29 | | //! }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
   = note: `#[warn(clippy::needless_doctest_main)]` on by default

Check warning on line 160 in bdf-parser/src/properties.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `unwrap_or_else` to construct default value

warning: use of `unwrap_or_else` to construct default value
   --> bdf-parser/src/properties.rs:160:22
    |
160 |                     .unwrap_or_else(HashMap::new);
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default