ZENOTME commented on issue #46: URL: https://github.com/apache/datasketches-rust/issues/46#issuecomment-3694870642
> > In some cases > > [@ZENOTME](https://github.com/ZENOTME) Also, it would be helpful if you could call out those specific cases now so that we can build a pattern to resolve concrete issues rather than a hypothetical one. E.g. In [theta sketch](https://github.com/apache/datasketches-rust/pull/45/files#diff-0428a1dd9624aa7544e0ff7fcf013f0d02666f87c174f951070dda8c8b31121bR146), the builder is better to return an error rather than asserting. ``` impl ThetaSketchBuilder { /// Set lg_k (log2 of nominal size k) pub fn set_lg_k(mut self, lg_k: u8) -> Self { // # TODO // Return as error assert!( (MIN_LG_K..=MAX_LG_K).contains(&lg_k), "lg_k must be in [{}, {}], got {}", MIN_LG_K, MAX_LG_K, lg_k ); self.lg_k = lg_k; self } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
