Skip to content

Commit 830f867

Browse files
fix beta clippy warnings
1 parent eda3b8f commit 830f867

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

gdk4/src/content_formats_builder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use glib::translate::*;
55

66
impl ContentFormatsBuilder {
77
#[doc(alias = "gdk_content_formats_builder_add_formats")]
8+
#[must_use]
89
pub fn add_formats(self, formats: &ContentFormats) -> Self {
910
unsafe {
1011
ffi::gdk_content_formats_builder_add_formats(
@@ -17,6 +18,7 @@ impl ContentFormatsBuilder {
1718
}
1819

1920
#[doc(alias = "gdk_content_formats_builder_add_gtype")]
21+
#[must_use]
2022
pub fn add_type(self, type_: glib::types::Type) -> Self {
2123
unsafe {
2224
ffi::gdk_content_formats_builder_add_gtype(self.to_glib_none().0, type_.into_glib());
@@ -26,6 +28,7 @@ impl ContentFormatsBuilder {
2628
}
2729

2830
#[doc(alias = "gdk_content_formats_builder_add_mime_type")]
31+
#[must_use]
2932
pub fn add_mime_type(self, mime_type: &str) -> Self {
3033
unsafe {
3134
ffi::gdk_content_formats_builder_add_mime_type(

gdk4/src/keys.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ impl Key {
6464
}
6565

6666
#[doc(alias = "gdk_keyval_to_upper")]
67+
#[must_use]
6768
pub fn to_upper(&self) -> Self {
6869
skip_assert_initialized!();
6970
unsafe { from_glib(ffi::gdk_keyval_to_upper(self.into_glib())) }
7071
}
7172

7273
#[doc(alias = "gdk_keyval_to_lower")]
74+
#[must_use]
7375
pub fn to_lower(&self) -> Self {
7476
skip_assert_initialized!();
7577
unsafe { from_glib(ffi::gdk_keyval_to_lower(self.into_glib())) }

gtk4/src/subclass/entry_buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ fn text_n_chars(text: &str, n_chars: u32) -> &str {
299299
.expect(
300300
"The passed text to EntryBuffer contains fewer characters than what's passed as a length",
301301
);
302-
let pos_end = iter.next().unwrap_or_else(|| text.len());
302+
let pos_end = iter.next().unwrap_or(text.len());
303303
&text[..pos_end]
304304
} else if n_chars == 0 {
305305
// Avoid doing skipping to -1 char

0 commit comments

Comments
 (0)