-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ixdtf crate documentation #4866
Conversation
1b02047
to
df9ee56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for adding an annotation handler example here
utils/ixdtf/src/lib.rs
Outdated
//! (3) shows an unknown key-value annotation. In this situation, the annotation | ||
//! ##### Example 3 | ||
//! | ||
//! This example shows an unknown key-value annotation. In this situation, the annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example 3 is
//! - (3) `2024-03-02T08:48:00-05:00[u-ca=iso8601][!u-ca=iso8601]`
which is inconsistent with this text.
utils/ixdtf/src/lib.rs
Outdated
//! | ||
//! let _ = IxdtfParser::new(example_with_custom_key).parse_with_annotation_handler(|annotation| { | ||
//! if annotation.key == "answer-to-universe" { | ||
//! answer = Some(annotation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: since this is supposed to show you how to write one of these handlers correctly, please use get_or_insert
to retain the first value. Alternatively, implement the additional logic involving mismatched critical annotations.
df9ee56
to
a756354
Compare
a756354
to
6b60eb4
Compare
@nekevss Prefer using merge commits over rebases because it makes it harder to track changes, and the individual commits will be squashed anyway when landing on the main branch. |
@sffc Sounds good. Will do on future any future PRs. |
This PR cleans up the crate docs and README for
ixdtf
.The changes consist of: