Skip to content

Commit 4d974b6

Browse files
committed
Clippy
1 parent cfb1a87 commit 4d974b6

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/plan/pull.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ pub struct Pull<P: Implementable> {
4848
}
4949

5050
fn interleave(values: &[Value], constants: &[Aid]) -> Vec<Value> {
51-
if values.is_empty() {
52-
values.to_owned()
53-
} else if constants.is_empty() {
51+
if values.is_empty() || constants.is_empty() {
5452
values.to_owned()
5553
} else {
5654
let size: usize = values.len() + constants.len();

tests/pull_test.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ fn pull_level() {
125125
plan: Box::new(Plan::MatchAV(0, "admin?".to_string(), Bool(false))),
126126
pull_attributes: vec!["name".to_string(), "age".to_string()],
127127
path_attributes: vec![],
128+
cardinality_many: false,
128129
}),
129130
transactions: vec![vec![
130131
TxData::add(100, "admin?", Bool(true)),
@@ -172,6 +173,7 @@ fn pull_children() {
172173
plan: Box::new(Plan::MatchA(parent, "parent/child".to_string(), child)),
173174
pull_attributes: vec!["name".to_string(), "age".to_string()],
174175
path_attributes: vec!["parent/child".to_string()],
176+
cardinality_many: false,
175177
}),
176178
transactions: vec![vec![
177179
TxData::add(100, "name", String("Alice".to_string())),
@@ -242,7 +244,7 @@ fn pull() {
242244
plan: Plan::Pull(Pull {
243245
variables: vec![],
244246
paths: vec![
245-
PullLevel {
247+
Plan::PullLevel(PullLevel {
246248
variables: vec![],
247249
pull_variable: b,
248250
plan: Box::new(Plan::MatchA(a, "join/binding".to_string(), b)),
@@ -252,14 +254,16 @@ fn pull() {
252254
"pattern/v".to_string(),
253255
],
254256
path_attributes: vec!["join/binding".to_string()],
255-
},
256-
PullLevel {
257+
cardinality_many: false,
258+
}),
259+
Plan::PullLevel(PullLevel {
257260
variables: vec![],
258261
pull_variable: c,
259262
plan: Box::new(Plan::MatchA(a, "name".to_string(), c)),
260263
pull_attributes: vec![],
261264
path_attributes: vec!["name".to_string()],
262-
},
265+
cardinality_many: false,
266+
}),
263267
],
264268
}),
265269
transactions: vec![vec![

0 commit comments

Comments
 (0)