Skip to content

Commit

Permalink
prefer &[T] over &Vec<T> for params
Browse files Browse the repository at this point in the history
Dr-Emann committed Sep 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b6961cf commit d27c0df
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -150,7 +150,7 @@ async fn main() -> Result<()> {

for username in username_variants {
let results = check_username(&username, Arc::clone(&arc_targets), &check_options).await?;
save_results(&username, results, &save_options)?;
save_results(&username, &results, &save_options)?;
}

Ok(())
6 changes: 3 additions & 3 deletions src/output.rs
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ pub struct SaveOptions {
/// A Result containing the success or failure of the operation.
pub fn save_results(
username: &str,
results: Vec<QueryResult>,
results: &[QueryResult],
options: &SaveOptions,
) -> Result<()> {
let total_hits = results
@@ -56,7 +56,7 @@ pub fn save_results(
};

let mut file = File::create(&output_file)?;
for result in &results {
for result in results {
if result.status == QueryStatus::Claimed {
writeln!(file, "{}", result.site_url_user)?;
}
@@ -156,7 +156,7 @@ pub fn write_xlsx(
/// A Result containing the success or failure of the operation.
pub fn write_csv(
username: &str,
results: &Vec<QueryResult>,
results: &[QueryResult],
output_folder: Option<&str>,
print_all: bool,
print_found: bool,

0 comments on commit d27c0df

Please sign in to comment.