Skip to content

Commit bd74aa5

Browse files
committed
Deref/Mut<Target = Value> for ValueWithSpan
1 parent d5e147e commit bd74aa5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ast/value.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use alloc::string::String;
2020

2121
use core::fmt;
22+
use std::ops::{Deref, DerefMut};
2223

2324
#[cfg(feature = "bigdecimal")]
2425
use bigdecimal::BigDecimal;
@@ -111,6 +112,20 @@ impl From<ValueWithSpan> for Value {
111112
}
112113
}
113114

115+
impl Deref for ValueWithSpan {
116+
type Target = Value;
117+
118+
fn deref(&self) -> &Self::Target {
119+
&self.value
120+
}
121+
}
122+
123+
impl DerefMut for ValueWithSpan {
124+
fn deref_mut(&mut self) -> &mut Self::Target {
125+
&mut self.value
126+
}
127+
}
128+
114129
/// Primitive SQL values such as number and string
115130
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
116131
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

0 commit comments

Comments
 (0)