Skip to content

Commit a57f2c3

Browse files
Fix nightly clippy warnings
1 parent 0afb2a6 commit a57f2c3

21 files changed

+31
-50
lines changed

Diff for: gdk4-x11/src/functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use glib::{translate::*, IntoGStr};
3+
use glib::translate::*;
44
#[cfg(feature = "xlib")]
55
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
66
use x11::xlib::Atom as XAtom;

Diff for: gdk4-x11/src/x11_display.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{boxed::Box as Box_, mem::transmute};
77
#[cfg(feature = "xlib")]
88
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
99
use glib::signal::{connect_raw, SignalHandlerId};
10-
use glib::{translate::*, IntoGStr};
10+
use glib::translate::*;
1111
#[cfg(all(feature = "v4_4", feature = "egl"))]
1212
#[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "egl"))))]
1313
use khronos_egl as egl;

Diff for: gdk4/src/content_formats_builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use glib::{translate::*, IntoGStr};
3+
use glib::translate::*;
44

55
use crate::{ContentFormats, ContentFormatsBuilder};
66

Diff for: gdk4/src/display.rs

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use std::{mem, ptr};
4-
5-
use glib::{translate::*, IntoGStr};
3+
use glib::translate::*;
64

75
use crate::{prelude::*, Display, Key, KeymapKey, ModifierType};
86

@@ -69,10 +67,10 @@ pub trait DisplayExtManual: sealed::Sealed + IsA<Display> + 'static {
6967
group: i32,
7068
) -> Option<(Key, i32, i32, ModifierType)> {
7169
unsafe {
72-
let mut keyval = mem::MaybeUninit::uninit();
73-
let mut effective_group = mem::MaybeUninit::uninit();
74-
let mut level = mem::MaybeUninit::uninit();
75-
let mut consumed = mem::MaybeUninit::uninit();
70+
let mut keyval = std::mem::MaybeUninit::uninit();
71+
let mut effective_group = std::mem::MaybeUninit::uninit();
72+
let mut level = std::mem::MaybeUninit::uninit();
73+
let mut consumed = std::mem::MaybeUninit::uninit();
7674
let ret = from_glib(ffi::gdk_display_translate_key(
7775
self.as_ref().to_glib_none().0,
7876
keycode,
@@ -122,8 +120,8 @@ pub trait DisplayExtManual: sealed::Sealed + IsA<Display> + 'static {
122120
#[doc(alias = "gdk_display_map_keyval")]
123121
fn map_keyval(&self, keyval: Key) -> Option<Vec<KeymapKey>> {
124122
unsafe {
125-
let mut keys = ptr::null_mut();
126-
let mut n_keys = mem::MaybeUninit::uninit();
123+
let mut keys = std::ptr::null_mut();
124+
let mut n_keys = std::mem::MaybeUninit::uninit();
127125
let ret = from_glib(ffi::gdk_display_map_keyval(
128126
self.as_ref().to_glib_none().0,
129127
keyval.into_glib(),
@@ -144,9 +142,9 @@ pub trait DisplayExtManual: sealed::Sealed + IsA<Display> + 'static {
144142
#[doc(alias = "gdk_display_map_keycode")]
145143
fn map_keycode(&self, keycode: u32) -> Option<Vec<(KeymapKey, Key)>> {
146144
unsafe {
147-
let mut keys = ptr::null_mut();
148-
let mut keyvals = ptr::null_mut();
149-
let mut n_entries = mem::MaybeUninit::uninit();
145+
let mut keys = std::ptr::null_mut();
146+
let mut keyvals = std::ptr::null_mut();
147+
let mut n_entries = std::mem::MaybeUninit::uninit();
150148
let ret = from_glib(ffi::gdk_display_map_keycode(
151149
self.as_ref().to_glib_none().0,
152150
keycode,

Diff for: gdk4/src/rgba.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::{fmt, str::FromStr};
44

5-
use glib::{translate::*, IntoGStr};
5+
use glib::translate::*;
66

77
use crate::RGBA;
88

Diff for: gsk4/src/transform.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use glib::{translate::*, IntoGStr};
3+
use glib::translate::*;
44

55
use crate::Transform;
66

Diff for: gtk4-macros/src/attribute_parser.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ fn parse_attribute(meta: &NestedMeta) -> Result<(String, String)> {
136136
}
137137

138138
pub enum FieldAttributeArg {
139+
#[allow(dead_code)]
140+
// The span is needed for xml_validation feature
139141
Id(String, Span),
140142
Internal(bool),
141143
}
@@ -148,8 +150,6 @@ pub enum FieldAttributeType {
148150
pub struct FieldAttribute {
149151
pub ty: FieldAttributeType,
150152
pub args: Vec<FieldAttributeArg>,
151-
pub path_span: Span,
152-
pub span: Span,
153153
}
154154

155155
pub struct AttributedField {
@@ -292,7 +292,6 @@ fn parse_field(field: &Field) -> Result<Option<AttributedField>, Error> {
292292

293293
for field_attr in field_attrs {
294294
let span = field_attr.span();
295-
let path_span = field_attr.path.span();
296295
let ty = if field_attr.path.is_ident("template_child") {
297296
Some(FieldAttributeType::TemplateChild)
298297
} else {
@@ -303,12 +302,7 @@ fn parse_field(field: &Field) -> Result<Option<AttributedField>, Error> {
303302
let args = parse_field_attr_args(&ty, field_attr)?;
304303

305304
if attr.is_none() {
306-
attr = Some(FieldAttribute {
307-
ty,
308-
args,
309-
path_span,
310-
span,
311-
})
305+
attr = Some(FieldAttribute { ty, args })
312306
} else {
313307
return Err(Error::new(
314308
span,

Diff for: gtk4-macros/src/composite_template_derive.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#[cfg(feature = "xml_validation")]
44
use std::collections::HashMap;
5-
use std::string::ToString;
65

76
use proc_macro2::TokenStream;
87
use proc_macro_error::{emit_call_site_error, emit_error};

Diff for: gtk4/src/application.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::{cell::RefCell, rc::Rc};
44

55
use gio::ApplicationFlags;
6-
use glib::{signal::SignalHandlerId, translate::*, IntoOptionalGStr};
6+
use glib::{signal::SignalHandlerId, translate::*};
77

88
use crate::{prelude::*, rt, Application};
99

Diff for: gtk4/src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::path::Path;
44

5-
use glib::{translate::*, IntoGStr, Object};
5+
use glib::{translate::*, Object};
66

77
use crate::{prelude::*, Builder};
88

Diff for: gtk4/src/dialog.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
rc::Rc,
99
};
1010

11-
use glib::{translate::*, IntoOptionalGStr};
11+
use glib::translate::*;
1212

1313
use crate::{prelude::*, Dialog, DialogFlags, ResponseType, Widget, Window};
1414

Diff for: gtk4/src/entry.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use std::convert::TryFrom;
4-
53
use glib::translate::*;
64

75
use crate::{prelude::*, Entry};

Diff for: gtk4/src/entry_buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use glib::{translate::*, GString, IntoGStr, IntoOptionalGStr};
3+
use glib::{translate::*, GString};
44
use libc::{c_int, c_uint};
55

66
use crate::{prelude::*, EntryBuffer};

Diff for: gtk4/src/file_chooser.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use glib::{translate::*, IntoGStr};
4-
53
use crate::{prelude::*, FileChooser};
4+
use glib::translate::*;
65

76
mod sealed {
87
pub trait Sealed {}

Diff for: gtk4/src/file_chooser_dialog.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::ptr;
44

5-
use glib::{translate::*, IntoOptionalGStr};
5+
use glib::translate::*;
66
use libc::c_char;
77

88
use crate::{prelude::*, FileChooserAction, FileChooserDialog, ResponseType, Widget, Window};

Diff for: gtk4/src/icon_theme.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use glib::{translate::*, IntoGStr, Slice};
3+
use glib::{translate::*, Slice};
44

55
use crate::IconTheme;
66

Diff for: gtk4/src/message_dialog.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
use std::ptr;
44

5-
use glib::{translate::*, IntoGStr, IntoOptionalGStr};
6-
use libc::c_char;
5+
use glib::translate::*;
76

87
use crate::{prelude::*, ButtonsType, DialogFlags, MessageDialog, MessageType, Widget, Window};
98

@@ -26,9 +25,9 @@ impl MessageDialog {
2625
flags.into_glib(),
2726
type_.into_glib(),
2827
buttons.into_glib(),
29-
b"%s\0".as_ptr() as *const c_char,
28+
b"%s\0".as_ptr() as *const libc::c_char,
3029
message.as_ptr(),
31-
ptr::null::<c_char>(),
30+
ptr::null::<libc::c_char>(),
3231
))
3332
.unsafe_cast()
3433
})

Diff for: gtk4/src/response_type.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
use std::fmt;
44

55
use crate::prelude::*;
6-
use glib::{
7-
translate::*,
8-
value::{FromValue, ValueType},
9-
Type, Value,
10-
};
6+
use glib::{translate::*, value::FromValue, Type, Value};
117

128
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
139
#[doc(alias = "GtkResponseType")]

Diff for: gtk4/src/snapshot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::borrow::Borrow;
44

5-
use glib::{translate::*, IntoGStr};
5+
use glib::translate::*;
66

77
use crate::{prelude::*, Snapshot};
88

Diff for: gtk4/src/string_list.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use std::iter::FromIterator;
4-
53
use crate::{prelude::*, StringList};
64

75
impl FromIterator<&'static str> for StringList {

Diff for: gtk4/src/text.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::mem::transmute;
55
use glib::{
66
signal::{connect_raw, SignalHandlerId},
77
translate::*,
8-
GString, IntoGStr,
8+
GString,
99
};
1010

1111
use crate::{prelude::*, DeleteType, MovementStep, Text, Widget};

0 commit comments

Comments
 (0)