Skip to main content

Lint clippy::items_after_statements

warning clippy::items_after_statements §

adding items after statements is confusing, since items exist from the start of the scope

src/lint/fetch.rs:42:9

Clippy · Category: pedantic · cargo-clippy-html

Official Clippy documentation

Targets (1)
  • cargo-clippy-html (bin)

Primary: src/lint/fetch.rs:42:9

        struct Broken;

help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#items_after_statements

note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`

help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]`

Rendered diagnostic (text)
warning: adding items after statements is confusing, since items exist from the start of the scope
  --> src/lint/fetch.rs:42:9
   |
42 |         struct Broken;
   |         ^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#items_after_statements
   = note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]`

warning clippy::items_after_statements §

adding items after statements is confusing, since items exist from the start of the scope

src/lint/fetch.rs:43:9

Clippy · Category: pedantic · cargo-clippy-html

Official Clippy documentation

Targets (1)
  • cargo-clippy-html (bin)

Primary: src/lint/fetch.rs:43:9

        impl Read for Broken {
            fn read(&mut self, _: &mut [u8]) -> std::io::Result<usize> {
                Err(std::io::Error::other("body failed"))
            }
        }

help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#items_after_statements

Rendered diagnostic (text)
warning: adding items after statements is confusing, since items exist from the start of the scope
  --> src/lint/fetch.rs:43:9
   |
43 | /         impl Read for Broken {
44 | |             fn read(&mut self, _: &mut [u8]) -> std::io::Result<usize> {
45 | |                 Err(std::io::Error::other("body failed"))
46 | |             }
47 | |         }
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#items_after_statements