Skip to content

Commit

Permalink
fix typo & refine doc
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jun 10, 2024
1 parent 0520dbe commit d6b28be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/common/src/types/cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
use super::{Datum, DatumRef, ToDatumRef, ToOwnedDatum};

/// 🐮 A borrowed [`DatumRef`] or an owned [`Datum`].
///
/// We do not use [`std::borrow::Cow`] because it requires the borrowed variant
/// to be a reference, whereas what we have is a [`DatumRef`] with a lifetime.
#[derive(Debug, Clone)]
pub enum DatumCow<'a> {
Borrowed(DatumRef<'a>),
Expand Down
2 changes: 1 addition & 1 deletion src/connector/codec/src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub trait Access {
.map(ToOwnedDatum::to_owned_datum)
}

/// Similar to `access`, but may return a borrowed [`DatumCow::Ref`] to avoid unnecessary allocation.
/// Similar to `access`, but may return a borrowed [`DatumCow::Borrowed`] to avoid unnecessary allocation.
/// If not overridden, it will call forward to `access` and always wrap the result in [`DatumCow::Owned`].
///
/// This should be preferred over `access` for both callers and implementors.
Expand Down

0 comments on commit d6b28be

Please sign in to comment.