diff --git a/src/common/src/types/cow.rs b/src/common/src/types/cow.rs index 65e3bd6a741fe..bc0b6065dd605 100644 --- a/src/common/src/types/cow.rs +++ b/src/common/src/types/cow.rs @@ -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>), diff --git a/src/connector/codec/src/decoder/mod.rs b/src/connector/codec/src/decoder/mod.rs index 54ff3ef56f17a..8e5d15221970f 100644 --- a/src/connector/codec/src/decoder/mod.rs +++ b/src/connector/codec/src/decoder/mod.rs @@ -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.