Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions aw-client-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ impl AwClient {
&self,
bucketname: &str,
buckettype: &str,
) -> Result<(), reqwest::Error> {
) -> Result<Bucket, reqwest::Error> {
let bucket = Bucket {
bid: None,
id: bucketname.to_string(),
id: format!("{}_{}", bucketname, self.hostname),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. I suggest to keep the original behavior to avoid mishaps.

Suggested change
id: format!("{}_{}", bucketname, self.hostname),
id: bucketname.to_string(),

If you want your ID with a hostname suffix, better pass a different bucketname instead of adding this assumption to the create_bucket_simple method.

client: self.name.clone(),
_type: buckettype.to_string(),
hostname: self.hostname.clone(),
Expand All @@ -75,7 +75,8 @@ impl AwClient {
created: None,
last_updated: None,
};
self.create_bucket(&bucket)
self.create_bucket(&bucket)?;
Ok(bucket)
}

pub fn delete_bucket(&self, bucketname: &str) -> Result<(), reqwest::Error> {
Expand Down