Xuanwo commented on code in PR #25:
URL: https://github.com/apache/iceberg-rust/pull/25#discussion_r1285754296
##########
crates/iceberg/src/error.rs:
##########
@@ -241,6 +241,11 @@ impl Error {
pub fn kind(&self) -> ErrorKind {
self.kind
}
+
+ /// Return error's message.
+ pub fn msg(&self) -> &str {
Review Comment:
How about use `message` directly for better reading?
##########
crates/iceberg/src/error.rs:
##########
@@ -259,6 +264,25 @@ define_from_err!(
"handling invalid utf-8 characters"
);
+/// Helper macro to check arguments.
+///
+///
+/// Example:
+///
+/// Following example check `a > 0`, otherwise returns an error.
+/// ```ignore
+/// use iceberg::check;
+/// check!(a > 0, "{} is not positive.", a);
+/// ```
+#[macro_export]
+macro_rules! check {
Review Comment:
`check` is so general that could be confusion, how about take the idea
`ensure` from anyhow: `ensure_data_valid`?
--
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]