Skip to content

Commit

Permalink
Fix some clippy issues (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
reaper47 authored Jan 9, 2025
1 parent 7d71af3 commit eb0432a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
12 changes: 6 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::process::Command;
use std::{env, process, process::Command};

fn main() {
if std::env::var("SKIP_BUILD_RS").is_ok() {
if env::var("SKIP_BUILD_RS").is_ok() {
println!("Skipping build.rs tasks");
return;
}
Expand All @@ -12,8 +12,8 @@ fn main() {
.expect("Failed to install npm packages");

if !status.success() {
eprintln!("npm install failed with status: {}", status);
std::process::exit(1);
println!("npm install failed with status: {status}");
process::exit(1);
}

let status = Command::new("npm")
Expand All @@ -22,7 +22,7 @@ fn main() {
.expect("Failed to build the web app");

if !status.success() {
eprintln!("npm build failed with status: {}", status);
std::process::exit(1);
println!("npm build failed with status: {status}");
process::exit(1);
}
}
2 changes: 1 addition & 1 deletion src/model/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const MIGRATIONS: EmbeddedMigrations = embed_migrations!("src/model/store/migrat
///
pub fn establish_connection() -> SqliteConnection {
let mut conn = SqliteConnection::establish("./data/metal.db").unwrap_or_else(|_| {
eprintln!("Error connecting to {}", "./data/metal.db");
eprintln!("Error connecting to ./data/metal.db");
std::process::exit(1);
});

Expand Down
9 changes: 8 additions & 1 deletion src/scraper/wiki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,7 @@ mod tests {
14,
vec![
Release::new("Bleeding Through", "Nine"),
Release::new("Church Tongue", "You'll Know It Was Me (EP)"),
Release::new("Dawn of Solace", "Affliction Vortex"),
Release::new("Dynazty", "Game of Faces"),
Release::new("Lacuna Coil", "Sleepless Empire"),
Expand All @@ -2199,6 +2200,7 @@ mod tests {
(
21,
vec![
Release::new("David Lee Roth", "The Warner Recordings 1985–1994 (box set)"),
Release::new("Hirax", "Faster Than Death"),
Release::new("Killswitch Engage", "This Consequence"),
Release::new("Manntra", "Titans"),
Expand Down Expand Up @@ -2230,6 +2232,8 @@ mod tests {
7,
vec![
Release::new("Destruction", "Birth of Malice"),
Release::new("Edge of Paradise", "Prophecy"),
Release::new("Sadist", "Something to Pierce"),
Release::new("Smith / Kotzen", "Black Light / White Noise"),
Release::new("Spiritbox", "Tsunami Sea"),
],
Expand All @@ -2246,7 +2250,10 @@ mod tests {
Release::new("Warbringer", "Wrath and Ruin"),
],
),
(21, vec![Release::new("Lordi", "Limited Deadition")]),
(21, vec![
Release::new("Lordi", "Limited Deadition"),
Release::new("Pop Evil", "What Remains"),
]),
(
28,
vec![
Expand Down
4 changes: 2 additions & 2 deletions src/support/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn send_email(smtp_config: &SmtpConfig, from: String, body: impl Into<String
let email = match Message::builder()
.from(from.clone())
.reply_to(from)
.to(smtp_email_admin.into())
.to(smtp_email_admin)
.subject("Heavy Metal Releases Enquiry")
.header(ContentType::TEXT_PLAIN)
.body(body.into())
Expand All @@ -45,7 +45,7 @@ pub fn send_email(smtp_config: &SmtpConfig, from: String, body: impl Into<String
}
};

let mailer = match SmtpTransport::relay(&smtp_relay) {
let mailer = match SmtpTransport::relay(smtp_relay) {
Ok(transport) => {
let creds = Credentials::new(smtp_username.into(), smtp_password.into());

Expand Down
2 changes: 1 addition & 1 deletion src/web/handlers_calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async fn feed_handler(
now.day()
);

let custom_feed_id = feed_query.id.unwrap_or_else(|| -1);
let custom_feed_id = feed_query.id.unwrap_or(-1);

match state.feed_repo.get(12, custom_feed_id) {
Ok(feeds) => (
Expand Down

0 comments on commit eb0432a

Please sign in to comment.