Fix clippy warnings
This commit is contained in:
parent
d6aadfecac
commit
94ffc054a7
3 changed files with 16 additions and 2 deletions
|
@ -100,7 +100,7 @@ impl Thing {
|
||||||
self,
|
self,
|
||||||
ctx: &Runtime,
|
ctx: &Runtime,
|
||||||
opt: &Options,
|
opt: &Options,
|
||||||
stm: &Statement,
|
_stm: &Statement,
|
||||||
txn: &Transaction,
|
txn: &Transaction,
|
||||||
chn: &Sender<(Option<Thing>, Value)>,
|
chn: &Sender<(Option<Thing>, Value)>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
@ -122,7 +122,7 @@ impl Table {
|
||||||
self,
|
self,
|
||||||
ctx: &Runtime,
|
ctx: &Runtime,
|
||||||
opt: &Options,
|
opt: &Options,
|
||||||
stm: &Statement,
|
_stm: &Statement,
|
||||||
txn: &Transaction,
|
txn: &Transaction,
|
||||||
chn: &Sender<(Option<Thing>, Value)>,
|
chn: &Sender<(Option<Thing>, Value)>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
|
|
@ -18,4 +18,5 @@ mod patch;
|
||||||
mod pick;
|
mod pick;
|
||||||
mod replace;
|
mod replace;
|
||||||
mod set;
|
mod set;
|
||||||
|
mod single;
|
||||||
mod value;
|
mod value;
|
||||||
|
|
13
lib/src/sql/value/single.rs
Normal file
13
lib/src/sql/value/single.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
use crate::sql::value::Value;
|
||||||
|
|
||||||
|
impl Value {
|
||||||
|
pub fn single(&self) -> &Self {
|
||||||
|
match self {
|
||||||
|
Value::Array(v) => match v.value.first() {
|
||||||
|
None => &Value::None,
|
||||||
|
Some(v) => v,
|
||||||
|
},
|
||||||
|
v => v,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue