Skip to content

Commit

Permalink
chore(deps): bump thiserror from 1.0.67 to 2.0.3 (#314)
Browse files Browse the repository at this point in the history
* chore(deps): bump thiserror from 1.0.67 to 2.0.3

Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.67 to 2.0.3.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@1.0.67...2.0.3)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: fix clippy errors

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jean Mainguy <[email protected]>
  • Loading branch information
dependabot[bot] and jhandguy authored Dec 2, 2024
1 parent 53940f4 commit 311def3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
34 changes: 27 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ aws-runtime = "1"
aws-sdk-sts = "1"
aws-smithy-runtime-api = "1"
clap = { version = "4", features = ["derive", "env"] }
thiserror = "1"
thiserror = "2"
time = "0"
tokio = { version = "1", features = ["full"] }

Expand Down
4 changes: 2 additions & 2 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AWS_SESSION_EXPIRATION_TIMESTAMP: &str = "AWS_SESSION_EXPIRATION_TIMESTAMP
pub async fn get_env_credentials(
provider: EnvironmentVariableCredentialsProvider,
) -> Result<Option<Credentials>, Error> {
return match var(AWS_SESSION_EXPIRATION_TIMESTAMP) {
match var(AWS_SESSION_EXPIRATION_TIMESTAMP) {
Ok(var) => match var.parse::<i64>() {
Ok(session_expiration_timestamp) => {
let credentials = provider
Expand All @@ -37,5 +37,5 @@ pub async fn get_env_credentials(
var: String::from(AWS_SESSION_EXPIRATION_TIMESTAMP),
source: e,
}),
};
}
}
4 changes: 2 additions & 2 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ fn find_credentials(file_content: &str, profile: &str) -> Option<Credentials> {
}

fn replace_credentials(file_content: &str, profile: &str, content: &str) -> String {
return file_content
file_content
.split("\n\n")
.filter(|l| !l.is_empty() && !l.contains(format!("[{profile}]").as_str()))
.collect::<Vec<&str>>()
.join("\n\n")
.add(content);
.add(content)
}

pub fn find_auth_credentials(home: &str, profile: &str) -> Result<Option<Credentials>, Error> {
Expand Down

0 comments on commit 311def3

Please sign in to comment.