tisonkun commented on code in PR #47:
URL: https://github.com/apache/datasketches-rust/pull/47#discussion_r2650114957


##########
datasketches/src/tdigest/sketch.rs:
##########
@@ -75,6 +78,32 @@ impl TDigestMut {
         )
     }
 
+    /// Creates a tdigest instance with the given value of k.
+    ///
+    /// The panicking version of this method is [`TDigestMut::new`].
+    ///
+    /// # Errors
+    ///
+    /// If k is less than 10, returns [`ErrorKind::InvalidArgument`].
+    pub fn try_new(k: u16) -> Result<Self, Error> {

Review Comment:
   Demonstrate how a fallible version can be made.
   
   We may later apply the same to `cdf`/`pmf`/`rank`/`quantile`.



-- 
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]

Reply via email to