Skip to content

Commit b8076e0

Browse files
authored
Merge pull request diesel-rs#1147 from weiznich/bugfix/add_missing_clone
Add missing clone implementation for Many
2 parents 1f3d7b1 + 9f946d1 commit b8076e0

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

diesel/src/expression/array_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl<'a, ST, QS, DB> AsInExpression<ST>
152152
}
153153
}
154154

155-
#[derive(Debug)]
155+
#[derive(Debug, Clone)]
156156
pub struct Many<T>(Vec<T>);
157157

158158
impl<T: Expression> Expression for Many<T> {

diesel_tests/tests/joins.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,20 @@ fn join_with_explicit_on_clause() {
312312
let post_one = posts::table.filter(posts::title.eq("Post One"))
313313
.first::<Post>(&connection)
314314
.unwrap();
315-
let expected_data = vec![
315+
let expected_data = Ok(vec![
316316
(sean, post_one.clone()),
317317
(tess, post_one),
318-
];
318+
]);
319319

320320
let data = users::table.inner_join(posts::table.on(posts::title.eq("Post One")))
321321
.load(&connection);
322322

323-
assert_eq!(Ok(expected_data), data);
323+
assert_eq!(expected_data, data);
324+
325+
let data = users::table.inner_join(posts::table.on(posts::title.eq_any(vec!["Post One"])))
326+
.load(&connection);
327+
328+
assert_eq!(expected_data, data);
324329
}
325330

326331
#[test]

0 commit comments

Comments
 (0)