Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test deny warnings #1098

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 11 additions & 24 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
// use std::path::PathBuf;

// use env_logger::Env;
// use futures::{stream::FuturesUnordered, StreamExt};
// use log::info;

// use structopt::StructOpt;

// #[derive(Debug, StructOpt)]
// #[structopt(
// // name, // from Cargo.toml,
// about, // needed otherwise it doesn't show description from Cargo.toml,
// author // needed otherwise it doesn't show author from Cargo.toml
// )]
// struct Opt {
// #[structopt(
// // verbatim_doc_comment,
// help = "Some help",
// parse(from_os_str)
// )]
// some_value: PathBuf,
// }

fn foo() -> &'static str {
"Foo"
}
Expand All @@ -35,14 +12,24 @@

fn main() -> Result<(), color_eyre::Report> {
color_eyre::install()?;

println!("{}", foo());
println!("{}", bar());
println!("{}", quz());

let héllo = "accent?";

Check failure on line 19 in src/main.rs

View workflow job for this annotation

GitHub Actions / Cargo clippy (and report)

identifier contains non-ASCII characters

error: identifier contains non-ASCII characters --> src/main.rs:19:9 | 19 | let héllo = "accent?"; | ^^^^^ | = note: requested on the command line with `-D non-ascii-idents`
println!("{}", héllo);

let foo = "foo";

Check failure on line 22 in src/main.rs

View workflow job for this annotation

GitHub Actions / Cargo clippy (and report)

use of a disallowed/placeholder name `foo`

error: use of a disallowed/placeholder name `foo` --> src/main.rs:22:9 | 22 | let foo = "foo"; | ^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names = note: `-D clippy::disallowed-names` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::disallowed_names)]`
let bar = "bar";

let outer = format!("{foo} {}", bar);
println!("{}", outer);

todo!("TODO");
}

fn i_am_dead() {}

Check failure on line 31 in src/main.rs

View workflow job for this annotation

GitHub Actions / Cargo clippy (and report)

function `i_am_dead` is never used

error: function `i_am_dead` is never used --> src/main.rs:31:4 | 31 | fn i_am_dead() {} | ^^^^^^^^^ | = note: `-D dead-code` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(dead_code)]`

#[cfg(test)]
mod tests {
use super::{bar, foo, quz};
Expand Down
Loading