Skip to content

Clippy lints #156

@bjones1

Description

@bjones1

When developing with this library, I noticed quite a few clippy lints. Are the maintainers open to a PR to fixes many of these?

For example:

warning: the borrowed expression implements the required traits
   --> src\generation\cmark\parse_cmark_ast.rs:255:11
    |
255 |           &format!("Found end tag with level {}, but expected {}", end_level, level),
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Found end tag with level {}, but expected {}", end_level, level)`
    |
    = 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

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> src\generation\cmark\parse_cmark_ast.rs:443:5
    |
443 | /     match event {
444 | |       Event::End(TagEnd::HtmlBlock) => break,
445 | |       _ => {}
446 | |     }
    | |_____^ help: try: `if let Event::End(TagEnd::HtmlBlock) = event { break }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default

warning: the borrowed expression implements the required traits
   --> src\generation\cmark\parse_cmark_ast.rs:573:7
    |
573 |       &format!("Expected a table head event, but found: {:?}", head_event),
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Expected a table head event, but found: {:?}", head_event)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
   --> src\generation\cmark\parse_cmark_ast.rs:585:11
    |
585 |           &format!("Unexpected event kind in table: {:?}", event),
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected event kind in table: {:?}", event)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
   --> src\generation\cmark\parse_cmark_ast.rs:620:11
    |
620 |           &format!("Unexpected event kind in table head: {:?}", event),
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected event kind in table head: {:?}", event)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
   --> src\generation\cmark\parse_cmark_ast.rs:643:11
    |
643 |           &format!("Unexpected event kind in table row: {:?}", event),
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected event kind in table row: {:?}", event)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: unneeded `return` statement
  --> src\generation\cmark\parsing\common.rs:34:3
   |
34 | /   return Err(ParseError::new(
35 | |     Range {
36 | |       start: start_pos,
37 | |       end: char_scanner.pos(),
38 | |     },
39 | |     &format!("Did not find container close char `{}`.", close_char),
40 | |   ));
   | |____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
   |
34 ~   Err(ParseError::new(
35 +     Range {
36 +       start: start_pos,
37 +       end: char_scanner.pos(),
38 +     },
39 +     &format!("Did not find container close char `{}`.", close_char),
40 ~   ))
   |

warning: the borrowed expression implements the required traits
  --> src\generation\cmark\parsing\common.rs:27:9
   |
27 |         &format!("Unexpected open container char `{}`.", open_char),
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected open container char `{}`.", open_char)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
  --> src\generation\cmark\parsing\common.rs:39:5
   |
39 |     &format!("Did not find container close char `{}`.", close_char),
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Did not find container close char `{}`.", close_char)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
  --> src\generation\cmark\parsing\parse_image.rs:23:7
   |
23 |       &format!("Link type not implemented {:?}", link_type),
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Link type not implemented {:?}", link_type)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
  --> src\generation\cmark\parsing\parse_link_reference_definitions.rs:25:9
   |
25 |         &format!("Unexpected token `{}` while parsing link reference definition.", c),
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected token `{}` while parsing link reference definition.", c)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::NotImplemented>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: `#[warn(clippy::from_over_into)]` on by default
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::SourceFile>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Heading>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Paragraph>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::BlockQuote>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Text>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::TextDecoration>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Html>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::FootnoteReference>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::FootnoteDefinition>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::InlineLink>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::ReferenceLink>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::ShortcutLink>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::AutoLink>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::LinkReference>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::InlineImage>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::ReferenceImage>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::List>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Item>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::TaskListMarker>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::SoftBreak>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::HardBreak>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Code>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::CodeBlock>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::HorizontalRule>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::Table>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::TableHead>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::TableRow>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::TableCell>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::MetadataBlock>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::DisplayMath>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src\generation\common\ast_nodes.rs:264:9
    |
264 |           impl Into<Node> for $node_name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
312 | / generate_node![
313 | |   NotImplemented,
314 | |   SourceFile,
315 | |   Heading,
...   |
344 | |   InlineMath
345 | | ];
    | |_- in this macro invocation
    |
    = help: replace the `Into` implementation with `From<generation::common::ast_nodes::InlineMath>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
    = note: this warning originates in the macro `generate_node` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: the borrowed expression implements the required traits
  --> src\generation\common\char_scanner.rs:92:11
   |
92 |           &format!("Unexpected token `{}` when expected `{}`.", c, searching_char),
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected token `{}` when expected `{}`.", c, searching_char)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: the borrowed expression implements the required traits
   --> src\generation\common\char_scanner.rs:102:7
    |
102 |       &format!("Did not find expected char of `{}`", searching_char),
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Did not find expected char of `{}`", searching_char)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

warning: all variants have the same postfix: `Indent`
  --> src\generation\gen_types.rs:16:1
   |
16 | / pub enum MemoizedRcPathKind {
17 | |   StartIndent(u32),
18 | |   StartWithSingleIndent(u32),
19 | |   FinishIndent(u32),
20 | | }
   | |_^
   |
   = help: remove the postfixes and use full paths to the variants instead of glob imports
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
   = note: `#[warn(clippy::enum_variant_names)]` on by default

warning: this `if` branch is empty
   --> src\generation\generate.rs:182:19
    |
182 |                   if matches!(last_node, Node::Text(_)) && matches!(node, Node::Text(_)) {}
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `matches!(last_node, Node::Text(_)) && matches!(node, Node::Text(_));`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_if
    = note: `#[warn(clippy::needless_if)]` on by default

warning: this expression creates a reference which is immediately dereferenced by the compiler
    --> src\generation\generate.rs:1045:17
     |
1045 |   items.push_sc(&delimiter);
     |                 ^^^^^^^^^^ help: change this to: `delimiter`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
     = note: `#[warn(clippy::needless_borrow)]` on by default

warning: this expression creates a reference which is immediately dereferenced by the compiler
    --> src\generation\generate.rs:1062:17
     |
1062 |   items.push_sc(&delimiter);
     |                 ^^^^^^^^^^ help: change this to: `delimiter`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: usage of a legacy numeric constant
    --> src\generation\generate.rs:1092:18
     |
1092 |       max_width: std::u32::MAX,
     |                  ^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
     = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
     |
1092 |       max_width: u32::MAX,
     |                  ~~~~~~~~

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src\generation\metadata.rs:22:29
   |
22 |     if scanner.is_next_text(&delimiter) {
   |                             ^^^^^^^^^^ help: change this to: `delimiter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src\generation\metadata.rs:23:25
   |
23 |       scanner.move_text(&delimiter);
   |                         ^^^^^^^^^^ help: change this to: `delimiter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: `dprint-plugin-markdown` (lib) generated 52 warnings (run `cargo clippy --fix --lib -p dprint-plugin-markdown` to apply 18 suggestions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions