diff --git a/cio/src/app_config.rs b/cio/src/app_config.rs index 681388285..e9b07aac9 100644 --- a/cio/src/app_config.rs +++ b/cio/src/app_config.rs @@ -265,7 +265,7 @@ from = 'test@testemaildomain.com' #[test] fn test_received_letter() { - let config: ApplyConfig = toml::from_str(&mock_apply_toml()).unwrap(); + let config: ApplyConfig = toml::from_str(mock_apply_toml()).unwrap(); let applicant = mock_applicant(); let letter = config.create_received_letter(&applicant); @@ -279,7 +279,7 @@ from = 'test@testemaildomain.com' #[test] fn test_rejection_letter() { - let config: ApplyConfig = toml::from_str(&mock_apply_toml()).unwrap(); + let config: ApplyConfig = toml::from_str(mock_apply_toml()).unwrap(); let applicant = mock_applicant(); let letter = config.create_rejection_letter("test-rejection", &applicant).unwrap(); @@ -293,7 +293,7 @@ from = 'test@testemaildomain.com' #[test] fn test_missing_rejection_letter() { - let config: ApplyConfig = toml::from_str(&mock_apply_toml()).unwrap(); + let config: ApplyConfig = toml::from_str(mock_apply_toml()).unwrap(); let applicant = mock_applicant(); let letter = config.create_rejection_letter("test-missing", &applicant); diff --git a/cio/src/applicants.rs b/cio/src/applicants.rs index 1745a6db2..070b56ed6 100644 --- a/cio/src/applicants.rs +++ b/cio/src/applicants.rs @@ -1238,7 +1238,7 @@ pub async fn get_file_contents(drive_client: &GoogleDrive, url: &str) -> Result< }; // Delete the temporary file, if it exists. - for p in vec![path, output] { + for p in [path, output] { if p.exists() && !p.is_dir() { fs::remove_file(p).await?; } @@ -1274,7 +1274,7 @@ async fn read_pdf(name: &str, path: std::path::PathBuf) -> Result { }; // Delete the temporary file, if it exists. - for p in vec![path, output] { + for p in [path, output] { if p.exists() && !p.is_dir() { fs::remove_file(p).await?; } diff --git a/cio/src/configs.rs b/cio/src/configs.rs index 9dc1fe85b..03f9c4418 100644 --- a/cio/src/configs.rs +++ b/cio/src/configs.rs @@ -3002,6 +3002,6 @@ manager = 'orb' assert_eq!(user.first_name, "Test"); assert_eq!(user.last_name, "User"); assert_eq!(user.denied_services, vec![]); - assert_eq!(user.gusto_pull_permission, false); + assert!(!user.gusto_pull_permission); } } diff --git a/cio/src/rfd/content.rs b/cio/src/rfd/content.rs index a8d50cda0..aecfc31ff 100644 --- a/cio/src/rfd/content.rs +++ b/cio/src/rfd/content.rs @@ -214,7 +214,7 @@ impl<'a> RFDContent<'a> { .replace("labels:", "") .trim() .to_string() - .split(";") + .split(';') .map(|label| label.to_string()) .collect::>(), None => Default::default(), @@ -1067,7 +1067,7 @@ in velit. "{}/tests/ref/asciidoc_to_pdf.pdf", std::env::var("CARGO_MANIFEST_DIR").unwrap() ); - let expected = std::fs::read(&ref_path).unwrap(); + let expected = std::fs::read(ref_path).unwrap(); assert_eq!(expected, pdf); } diff --git a/cio/tests/mailerlite.rs b/cio/tests/mailerlite.rs index 020718993..6fca08743 100644 --- a/cio/tests/mailerlite.rs +++ b/cio/tests/mailerlite.rs @@ -15,7 +15,7 @@ async fn test_mark_subscriber() { setup(); let client = cio_api::mailerlite::Mailerlite::new().unwrap(); - let res = client.mark_mailing_list_subscriber("").await.unwrap(); + let _res = client.mark_mailing_list_subscriber("").await.unwrap(); } #[ignore] @@ -27,10 +27,10 @@ async fn test_mark_batch() { let list = client.pending_mailing_list_subscribers().await.unwrap(); let batch = list.chunks(10).next().unwrap(); - let res = client.mark_mailing_list_subscribers(batch.to_vec()).await.unwrap(); + let _res = client.mark_mailing_list_subscribers(batch.to_vec()).await.unwrap(); let batch = list.chunks(10).next().unwrap(); - let res = client.mark_mailing_list_subscribers(batch.to_vec()).await.unwrap(); + let _res = client.mark_mailing_list_subscribers(batch.to_vec()).await.unwrap(); - let list = client.pending_mailing_list_subscribers().await.unwrap(); + let _list = client.pending_mailing_list_subscribers().await.unwrap(); } diff --git a/mailchimp-minimal-api/src/lib.rs b/mailchimp-minimal-api/src/lib.rs index 99cf75de8..9e8f68a8d 100644 --- a/mailchimp-minimal-api/src/lib.rs +++ b/mailchimp-minimal-api/src/lib.rs @@ -195,11 +195,11 @@ impl error::Error for MailChimpError { #[cfg(test)] mod tests { use super::{AuthMode, MailChimpError}; - use base64; + use std::str::from_utf8; - static VALID_FORMAT: &'static str = "5555555555555555-us6"; - static INVALID_FORMAT: &'static str = "5555555555555555us6"; + static VALID_FORMAT: &str = "5555555555555555-us6"; + static INVALID_FORMAT: &str = "5555555555555555us6"; #[test] fn test_computes_datacenter() { diff --git a/mailchimp-minimal-api/tests/list_subscribers.rs b/mailchimp-minimal-api/tests/list_subscribers.rs index a875bcd70..23370f88d 100644 --- a/mailchimp-minimal-api/tests/list_subscribers.rs +++ b/mailchimp-minimal-api/tests/list_subscribers.rs @@ -11,5 +11,5 @@ async fn test_get_subscriber_list() { .await .unwrap(); - assert!(0 < list.len()); + assert!(!list.is_empty()); } diff --git a/webhooky/src/sagas.rs b/webhooky/src/sagas.rs index ae9ca8aa2..8422debd3 100644 --- a/webhooky/src/sagas.rs +++ b/webhooky/src/sagas.rs @@ -245,8 +245,7 @@ mod tests { let lines = records .split('\n') - .into_iter() - .filter(|s| s.len() != 0) + .filter(|s| !s.is_empty()) .map(|s| serde_json::from_str::(s).unwrap()) .collect::>();