Use new ActiveValue::into_value()

This commit is contained in:
Billy Chan 2021-10-12 21:14:40 +08:00
parent 75e625fee9
commit 6ecc3138c3
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7

View File

@ -10,8 +10,7 @@ pub struct ActiveValue<V>
where where
V: Into<Value>, V: Into<Value>,
{ {
// Don't want to call ActiveValue::unwrap() and cause panic value: Option<V>,
pub(self) value: Option<V>,
state: ActiveValueState, state: ActiveValueState,
} }
@ -74,7 +73,7 @@ pub trait ActiveModelTrait: Clone + Debug {
macro_rules! next { macro_rules! next {
() => { () => {
if let Some(col) = cols.next() { if let Some(col) = cols.next() {
if let Some(val) = self.get(col.into_column()).value { if let Some(val) = self.get(col.into_column()).into_value() {
val val
} else { } else {
return None; return None;