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

Fix some clippy issues #56

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
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
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
Loading