Skip to content
Merged
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
22 changes: 11 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@

fn setup_logging() {
let verbose_logging =
dotenvy::var("VERBOSE_LOGGING").map_or(false, |val| val.to_lowercase().eq("true"));

Check warning on line 63 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this `map_or` can be simplified

warning: this `map_or` can be simplified --> src/main.rs:63:9 | 63 | dotenvy::var("VERBOSE_LOGGING").map_or(false, |val| val.to_lowercase().eq("true")); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `dotenvy::var("VERBOSE_LOGGING").is_ok_and(|val| val.to_lowercase().eq("true"))` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `#[warn(clippy::unnecessary_map_or)]` on by default
let error_log_path = dotenvy::var("ERROR_LOG_PATH").expect("ERROR_LOG_PATH must be set");
let app_log_path = dotenvy::var("APP_LOG_PATH").expect("APP_LOG_PATH must be set");
let mut log_level = log::LevelFilter::Warn;
if verbose_logging == true {

Check warning on line 67 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

equality checks against true are unnecessary

warning: equality checks against true are unnecessary --> src/main.rs:67:8 | 67 | if verbose_logging == true { | ^^^^^^^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `verbose_logging` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison = note: `#[warn(clippy::bool_comparison)]` on by default
log_level = log::LevelFilter::Debug;
}
let colors_line = ColoredLevelConfig::new()
Expand Down Expand Up @@ -146,17 +146,17 @@
],
)
// TODO - not enabling V2 yet, want to write unit-tests and such before potentially people start using them
// .mount(
// "/v2",
// routes![
// api::v2::get_latest_releases,
// api::v2::get_recent_releases,
// api::v2::get_release_changelog,
// api::v2::get_release_list,
// api::v2::handle_github_webhook_release_event,
// api::v2::admin_add_new_api_key,
// ],
// )
.mount(
"/v2",
routes![
// api::v2::get_latest_releases,
// api::v2::get_recent_releases,
// api::v2::get_release_changelog,
// api::v2::get_release_list,
api::v2::handle_github_webhook_release_event,
// api::v2::admin_add_new_api_key,
],
)
.attach(fairings::CORSHeaderFairing::default())
.manage(db)
.manage(rate_limiter)
Expand Down
Loading