Skip to content

Commit

Permalink
chore: Upgrade SDK to 0.4.0
Browse files Browse the repository at this point in the history
Signed-off-by: Vaibhav Rabber <[email protected]>
  • Loading branch information
vrongmeal committed Dec 16, 2024
1 parent 5c8aa33 commit 7303a95
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 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 @@ -28,7 +28,7 @@ miette = { version = "7.2.0", features = ["fancy"] }
rand = "0.8.5"
serde = { version = "1.0.214", features = ["derive"] }
serde_json = "1.0.132"
streamstore = "0.3.1"
streamstore = "0.4.0"
thiserror = "2.0.6"
tokio = { version = "1.41.1", features = ["full"] }
tokio-stream = { version = "0.1.16", features = ["io-util"] }
Expand Down
7 changes: 5 additions & 2 deletions src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ impl AccountService {
stream_config = stream_config.with_retention_policy(retention_policy.into());
}

let create_basin_req = CreateBasinRequest::new(basin)
.with_config(BasinConfig::with_default_stream_config(stream_config));
let basin_config = BasinConfig {
default_stream_config: Some(stream_config),
};

let create_basin_req = CreateBasinRequest::new(basin).with_config(basin_config);

self.client
.create_basin(create_basin_req)
Expand Down
2 changes: 1 addition & 1 deletion src/basin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl BasinService {
&self,
stream: String,
config: Option<StreamConfig>,
) -> Result<(), ServiceError> {
) -> Result<StreamInfo, ServiceError> {
let mut create_stream_req = CreateStreamRequest::new(stream);

if let Some(config) = config {
Expand Down
9 changes: 5 additions & 4 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ impl From<&str> for RetentionPolicy {

impl From<BasinConfig> for streamstore::types::BasinConfig {
fn from(config: BasinConfig) -> Self {
if let Some(default_stream_config) = config.default_stream_config.map(|c| c.into()) {
streamstore::types::BasinConfig::with_default_stream_config(default_stream_config)
} else {
streamstore::types::BasinConfig::default()
let BasinConfig {
default_stream_config,
} = config;
streamstore::types::BasinConfig {
default_stream_config: default_stream_config.map(Into::into),
}
}
}
Expand Down

0 comments on commit 7303a95

Please sign in to comment.