Skip to content

Commit

Permalink
Clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jupiter committed Mar 27, 2024
1 parent 90307bf commit 8160b18
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async fn output_for_command(mut reader: ParquetObjectReader, command: &Commands)
async_reader_builder = async_reader_builder.with_offset(absolute_offset);

if let Some(limit) = limit {
async_reader_builder = async_reader_builder.with_limit(limit.clone())
async_reader_builder = async_reader_builder.with_limit(*limit)
}

if let Some(columns) = columns {
Expand Down Expand Up @@ -142,29 +142,26 @@ async fn main() {
if file.as_str().starts_with("s3://") {
let mut s3_builder: AmazonS3Builder = AmazonS3Builder::from_env();

match load(
if let Ok(profile_set) = load(
&Fs::default(),
&Env::default(),
&ProfileFiles::default(),
None,
)
.await
{
Ok(profile_set) => {
if let Some(aws_access_key_id) = profile_set.get("aws_access_key_id") {
s3_builder = s3_builder.with_access_key_id(aws_access_key_id);
}
if let Some(aws_secret_access_key) = profile_set.get("aws_secret_access_key") {
s3_builder = s3_builder.with_secret_access_key(aws_secret_access_key);
}
if let Some(aws_session_token) = profile_set.get("aws_session_token") {
s3_builder = s3_builder.with_token(aws_session_token);
}
if let Some(region) = profile_set.get("region") {
s3_builder = s3_builder.with_region(region);
}
if let Some(aws_access_key_id) = profile_set.get("aws_access_key_id") {
s3_builder = s3_builder.with_access_key_id(aws_access_key_id);
}
if let Some(aws_secret_access_key) = profile_set.get("aws_secret_access_key") {
s3_builder = s3_builder.with_secret_access_key(aws_secret_access_key);
}
if let Some(aws_session_token) = profile_set.get("aws_session_token") {
s3_builder = s3_builder.with_token(aws_session_token);
}
if let Some(region) = profile_set.get("region") {
s3_builder = s3_builder.with_region(region);
}
Err(_) => {}
}

let url = Url::parse(file.as_ref()).unwrap();
Expand Down

0 comments on commit 8160b18

Please sign in to comment.