-
Notifications
You must be signed in to change notification settings - Fork 825
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
Improve GenericStringBuilder
documentation
#6372
Conversation
Co-authored-by: Raphael Taylor-Davies <[email protected]>
@@ -227,30 +243,51 @@ impl<T: ByteArrayType, V: AsRef<T::Native>> Extend<Option<V>> for GenericByteBui | |||
/// Values can be appended using [`GenericByteBuilder::append_value`], and nulls with | |||
/// [`GenericByteBuilder::append_null`]. | |||
/// | |||
/// Additionally, implements [`std::fmt::Write`] with any written data included in the next | |||
/// appended value. This allows use with [`std::fmt::Display`] without intermediate allocations | |||
/// This builder also implements [`std::fmt::Write`] with any written data |
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.
The point of the PR was to make this feature clearer
/// with standard Rust idioms like `write!` and `writeln!` to write data | ||
/// directly to the builder without intermediate allocations. | ||
/// | ||
/// # Example writing strings with `append_value` |
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.
This style is by far the most common in DataFusion (and I think in other systems)
/// assert_eq!(array.value(1), "v2"); | ||
/// ``` | ||
/// | ||
/// # Example incrementally writing strings with `std::fmt::Write` |
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.
This style could be used for certain kernels, so I think it is better t have it as its own example
Thank you for the (quick) review @tustvold |
Which issue does this PR close?
Closes #6347
Rationale for this change
I couldn't quickly discover that it was possible to incrementally build up strings with
GenericStringBuilder
from the documentationWhat changes are included in this PR?
Are there any user-facing changes?
Documentation change only, no functional changes