Skip to content

Commit 1b8bc33

Browse files
committed
glib: Fix some new clippy warnings
1 parent 86eeafe commit 1b8bc33

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

glib/src/convert.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ unsafe impl Send for IConv {}
115115

116116
impl IConv {
117117
#[doc(alias = "g_iconv_open")]
118+
#[allow(clippy::unnecessary_lazy_evaluations)]
118119
pub fn new(to_codeset: &str, from_codeset: &str) -> Option<Self> {
119120
let iconv = unsafe {
120121
ffi::g_iconv_open(to_codeset.to_glib_none().0, from_codeset.to_glib_none().0)

glib/src/log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<'a> LogField<'a> {
417417
/// Retrieves the the user data value from a field created with [`Self::new_user_data`].
418418
/// Returns `None` if the field was created with [`Self::new`].
419419
pub fn user_data(&self) -> Option<usize> {
420-
(self.0.length == 0).then(|| self.0.value as usize)
420+
(self.0.length == 0).then_some(self.0.value as usize)
421421
}
422422
}
423423

0 commit comments

Comments
 (0)