Skip to content

Commit

Permalink
clippy suggestions on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dougEfresh committed Feb 17, 2024
1 parent 17ad4f3 commit 68937d0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ mod tests {
let filter = EnvFilter::from_default_env();
let subscriber = tracing_subscriber::FmtSubscriber::builder().with_env_filter(filter).with_target(true).finish();
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
match INSTANCE.set(Config::new()) {
Err(_) => error!("failed to set test Config"),
Ok(_) => info!("config setup"),
if INSTANCE.set(Config::new()).is_err() {
error!("failed to set test Config")
} else {
info!("config setup")
}
});
}
Expand All @@ -73,9 +74,10 @@ mod tests {

pub fn new() -> Self {
let env = dotenvy::dotenv();
let key: Option<String> = match env {
_ => env::var("HELIUS_API_KEY").ok(),
};
if env.is_err() {
info!("no .env file");
}
let key: Option<String> = env::var("HELIUS_API_KEY").ok();
let client: Option<Helius> =
key.map(|k| HeliusBuilder::new(&k).timeout(Duration::from_secs(15)).build().unwrap());
Self { client }
Expand Down

0 comments on commit 68937d0

Please sign in to comment.