Skip to content

Commit 037994c

Browse files
committed
gio: Fix some more new clippy warnings
error: the borrowed expression implements the required traits --> gio/src/list_store.rs:164:21 | 164 | list.extend(&[&item0, &item1]); | ^^^^^^^^^^^^^^^^^ help: change this to: `[&item0, &item1]` | = note: `-D clippy::needless-borrow` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow error: the borrowed expression implements the required traits --> gio/src/settings.rs:183:23 | 183 | .args(&[ | _______________________^ 184 | | &format!("{}/tests", env!("CARGO_MANIFEST_DIR")), 185 | | "--targetdir", 186 | | env!("OUT_DIR"), 187 | | ]) | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow help: change this to | 183 ~ .args([ 184 + &format!("{}/tests", env!("CARGO_MANIFEST_DIR")), 185 + "--targetdir", 186 + env!("OUT_DIR"), 187 ~ ]) |
1 parent f40ccdc commit 037994c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gio/src/list_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ mod tests {
161161
let item0 = ListStore::new(ListStore::static_type());
162162
let item1 = ListStore::new(ListStore::static_type());
163163
let mut list = ListStore::new(ListStore::static_type());
164-
list.extend(&[&item0, &item1]);
164+
list.extend([&item0, &item1]);
165165
assert_eq!(list.item(0).as_ref(), Some(item0.upcast_ref()));
166166
assert_eq!(list.item(1).as_ref(), Some(item1.upcast_ref()));
167-
list.extend(&[item0.clone(), item1.clone()]);
167+
list.extend([item0.clone(), item1.clone()]);
168168
assert_eq!(list.item(2).as_ref(), Some(item0.upcast_ref()));
169169
assert_eq!(list.item(3).as_ref(), Some(item1.upcast_ref()));
170170

gio/src/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ mod test {
180180
fn set_env() {
181181
INIT.call_once(|| {
182182
let output = Command::new("glib-compile-schemas")
183-
.args(&[
183+
.args([
184184
&format!("{}/tests", env!("CARGO_MANIFEST_DIR")),
185185
"--targetdir",
186186
env!("OUT_DIR"),

0 commit comments

Comments
 (0)