Skip to content

Commit

Permalink
mess with references
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaylor89 committed Aug 24, 2024
1 parent b2a0836 commit 4f974ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct CheckOptions {
pub async fn check_username(
username: &str,
site_data: HashMap<String, TargetInfo>,
options: CheckOptions,
options: &CheckOptions,
) -> color_eyre::Result<Vec<QueryResult>> {
let CheckOptions {
timeout,
Expand All @@ -46,7 +46,7 @@ pub async fn check_username(
username.to_owned(),
site,
info,
timeout,
*timeout,
proxy.clone(),
)?;
}
Expand Down Expand Up @@ -124,7 +124,7 @@ pub async fn check_username(
}
};

if dump_response {
if *dump_response {
println!("+++++++++++++++++++++");
println!("TARGET NAME : {site}");
println!("USERNAME : {username}");
Expand All @@ -146,7 +146,7 @@ pub async fn check_username(
println!("+++++++++++++++++++++");
}

if browse && status == QueryStatus::Claimed {
if *browse && status == QueryStatus::Claimed {
open::that(&url).inspect_err(|e| eprintln!("Failed to open browser: {}", e))?;
}

Expand All @@ -163,7 +163,7 @@ pub async fn check_username(
}
};

if print_all || (print_found && query_result.status == QueryStatus::Claimed) {
if *print_all || (*print_found && query_result.status == QueryStatus::Claimed) {
print_result(&query_result);
}
results.push(query_result);
Expand Down
23 changes: 10 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,17 @@ async fn main() -> Result<()> {

let username_variants = create_username_variants(&cli.usernames);

let check_options = CheckOptions {
timeout: cli.timeout,
proxy: cli.proxy.clone(),
print_all: cli.print_all,
print_found: cli.print_found,
dump_response: cli.dump_response,
browse: cli.browse,
};

for username in username_variants {
let results = check_username(
&username,
filtered_targets.clone(),
CheckOptions {
timeout: cli.timeout,
proxy: cli.proxy.clone(),
print_all: cli.print_all,
print_found: cli.print_found,
dump_response: cli.dump_response,
browse: cli.browse,
},
)
.await?;
let results = check_username(&username, filtered_targets.clone(), &check_options).await?;
save_results(
&username,
results,
Expand Down

0 comments on commit 4f974ea

Please sign in to comment.