Skip to content

Conversation

hapm
Copy link

@hapm hapm commented Dec 16, 2022

create_bucket_simple should expose the created bucket for later use. This would allow to expose the id, which can be generated based on the bucket name given and the hostname, what in turn leads to simpler creation of a new Bucket, as intended by the function.

let bucket = Bucket {
bid: None,
id: bucketname.to_string(),
id: format!("{}_{}", bucketname, self.hostname),
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants