Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
augustuswm committed Dec 11, 2023
1 parent 5ab96b0 commit 3533e69
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cio/src/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ from = '[email protected]'

#[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);
Expand All @@ -279,7 +279,7 @@ from = '[email protected]'

#[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();
Expand All @@ -293,7 +293,7 @@ from = '[email protected]'

#[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);

Expand Down
4 changes: 2 additions & 2 deletions cio/src/applicants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
}
Expand Down Expand Up @@ -1274,7 +1274,7 @@ async fn read_pdf(name: &str, path: std::path::PathBuf) -> Result<String> {
};

// 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?;
}
Expand Down
2 changes: 1 addition & 1 deletion cio/src/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions cio/src/rfd/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<'a> RFDContent<'a> {
.replace("labels:", "")
.trim()
.to_string()
.split(";")
.split(';')
.map(|label| label.to_string())
.collect::<Vec<_>>(),
None => Default::default(),
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions cio/tests/mailerlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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();
}
6 changes: 3 additions & 3 deletions mailchimp-minimal-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion mailchimp-minimal-api/tests/list_subscribers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ async fn test_get_subscriber_list() {
.await
.unwrap();

assert!(0 < list.len());
assert!(!list.is_empty());
}
3 changes: 1 addition & 2 deletions webhooky/src/sagas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Line>(s).unwrap())
.collect::<Vec<_>>();

Expand Down

0 comments on commit 3533e69

Please sign in to comment.