Skip to content

Commit 09a333f

Browse files
committed
glib: Fix more new clippy warnings
error: deref which would be done by auto-deref --> glib/tests/log.rs:41:37 | 41 | LogLevel::Critical => { (*count.lock().expect("failed to lock 3")).criticals += 1; } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `count.lock().expect("failed to lock 3")` | = note: `-D clippy::explicit-auto-deref` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
1 parent 877514f commit 09a333f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

glib/src/gstring.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ impl_from_glib_container_as_vec_string!(GString, *const c_char);
10801080
impl_from_glib_container_as_vec_string!(GString, *mut c_char);
10811081

10821082
#[cfg(test)]
1083-
#[allow(clippy::blacklisted_name)]
1083+
#[allow(clippy::disallowed_names)]
10841084
mod tests {
10851085
use super::*;
10861086
use std::ffi::CString;

glib/tests/log.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ fn check_log_handlers() {
3838
let count = Arc::new(Mutex::new(Counters::default()));
3939
log_set_default_handler(clone!(@weak count => move |_, level, _| {
4040
match level {
41-
LogLevel::Critical => { (*count.lock().expect("failed to lock 3")).criticals += 1; }
42-
LogLevel::Warning => { (*count.lock().expect("failed to lock 4")).warnings += 1; }
43-
LogLevel::Message => { (*count.lock().expect("failed to lock 5")).messages += 1; }
44-
LogLevel::Info => { (*count.lock().expect("failed to lock 6")).infos += 1; }
45-
LogLevel::Debug => { (*count.lock().expect("failed to lock 7")).debugs += 1; }
41+
LogLevel::Critical => { count.lock().expect("failed to lock 3").criticals += 1; }
42+
LogLevel::Warning => { count.lock().expect("failed to lock 4").warnings += 1; }
43+
LogLevel::Message => { count.lock().expect("failed to lock 5").messages += 1; }
44+
LogLevel::Info => { count.lock().expect("failed to lock 6").infos += 1; }
45+
LogLevel::Debug => { count.lock().expect("failed to lock 7").debugs += 1; }
4646
_ => unreachable!(),
4747
}
4848
}));
@@ -76,8 +76,8 @@ fn check_log_handlers() {
7676
false,
7777
clone!(@weak count => move |_, level, _| {
7878
match level {
79-
LogLevel::Warning => { (*count.lock().expect("failed to lock 4")).warnings += 1; }
80-
LogLevel::Debug => { (*count.lock().expect("failed to lock 7")).debugs += 1; }
79+
LogLevel::Warning => { count.lock().expect("failed to lock 4").warnings += 1; }
80+
LogLevel::Debug => { count.lock().expect("failed to lock 7").debugs += 1; }
8181
_ => unreachable!(),
8282
}
8383
}),

0 commit comments

Comments
 (0)