Skip to content

Commit

Permalink
rename to borrowed
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jun 7, 2024
1 parent 9e998bc commit c7409a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/common/src/types/cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::{Datum, DatumRef, ToDatumRef, ToOwnedDatum};
/// 🐮 A borrowed [`DatumRef`] or an owned [`Datum`].
#[derive(Debug, Clone)]
pub enum DatumCow<'a> {
Ref(DatumRef<'a>),
Borrowed(DatumRef<'a>),
Owned(Datum),
}

Expand All @@ -36,14 +36,14 @@ impl From<Datum> for DatumCow<'_> {

impl<'a> From<DatumRef<'a>> for DatumCow<'a> {
fn from(datum: DatumRef<'a>) -> Self {
DatumCow::Ref(datum)
DatumCow::Borrowed(datum)
}
}

impl ToDatumRef for DatumCow<'_> {
fn to_datum_ref(&self) -> DatumRef<'_> {
match self {
DatumCow::Ref(datum) => *datum,
DatumCow::Borrowed(datum) => *datum,
DatumCow::Owned(datum) => datum.to_datum_ref(),
}
}
Expand All @@ -52,7 +52,7 @@ impl ToDatumRef for DatumCow<'_> {
impl ToOwnedDatum for DatumCow<'_> {
fn to_owned_datum(self) -> Datum {
match self {
DatumCow::Ref(datum) => datum.to_owned_datum(),
DatumCow::Borrowed(datum) => datum.to_owned_datum(),
DatumCow::Owned(datum) => datum,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/connector/src/parser/unified/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl JsonParseOptions {
.map_err(|_| create_error())?
.into(),
// ---- Varchar -----
(DataType::Varchar, ValueType::String) => return Ok(DatumCow::Ref(Some(value.as_str().unwrap().into()))),
(DataType::Varchar, ValueType::String) => return Ok(DatumCow::Borrowed(Some(value.as_str().unwrap().into()))),
(
DataType::Varchar,
ValueType::Bool
Expand Down

0 comments on commit c7409a0

Please sign in to comment.