google-cloud-rust icon indicating copy to clipboard operation
google-cloud-rust copied to clipboard

[Pubsub] Use the default `pool_size` value when `None` is provided

Open jdrouet opened this issue 4 months ago • 2 comments

In the documentation, it's encouraged to do the following

google_cloud_pubsub::client::ClientConfig {
  project_id: Some(String::from("foo")),
  ..Default::default()
}

But when we set the pool_size to None, the client will just try to divide by zero because pool_size is then replaced by zero, instead of the default value (being 4).

google_cloud_pubsub::client::ClientConfig {
  project_id: Some(String::from("foo")),
  pool_size: None,
  ..Default::default()
}

I'd expect the previous provide a client with a pool_size similar to the previous one. Another way to look at it would be to not make the pool_size optional.

jdrouet avatar Sep 05 '25 13:09 jdrouet

OK. I will change the pool_size type in next release.

yoshidan avatar Sep 07 '25 06:09 yoshidan

Using a NonZeroUsize would be perfect 😉

jdrouet avatar Sep 07 '25 19:09 jdrouet