Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit ce980b8

Browse files
clippy: run with --all-features
this should lets us catch some behind feature flag clippy warnings and fixes the current ones
1 parent 5861bb4 commit ce980b8

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
- uses: actions-rs/cargo@v1
136136
with:
137137
command: clippy
138-
args: -- -D warnings
138+
args: --all-features -- -D warnings
139139

140140
checker:
141141
name: gtk-rs checker

cairo/src/font/font_options.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ impl FontOptions {
121121
let v = CString::new(*v).unwrap();
122122
ffi::cairo_font_options_set_variations(self.to_raw_none(), v.as_ptr())
123123
}
124-
None => ffi::cairo_font_options_set_variations(self.to_raw_none(), 0 as *const _),
124+
None => {
125+
ffi::cairo_font_options_set_variations(self.to_raw_none(), std::ptr::null())
126+
}
125127
}
126128
}
127129
}

examples/src/bin/notebook.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ impl Notebook {
2525
let tab = gtk::Box::new(Orientation::Horizontal, 0);
2626

2727
button.set_relief(ReliefStyle::None);
28-
button.set_focus_on_click(false);
2928
button.add(&close_image);
3029

3130
tab.pack_start(&label, false, false, 0);

gdk-pixbuf/src/pixbuf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ impl Pixbuf {
396396
}
397397

398398
#[cfg(any(feature = "v2_32", feature = "dox"))]
399+
#[allow(clippy::type_complexity)]
399400
pub fn get_file_info_async_future<T: AsRef<Path> + Clone + 'static>(
400401
filename: T,
401402
) -> Pin<Box<dyn Future<Output = Result<Option<(PixbufFormat, i32, i32)>, Error>> + 'static>>
@@ -438,7 +439,7 @@ impl Pixbuf {
438439
}
439440

440441
#[cfg(any(feature = "v2_36", feature = "dox"))]
441-
pub fn save_to_streamv<'a, P: IsA<gio::OutputStream>, Q: IsA<gio::Cancellable>>(
442+
pub fn save_to_streamv<P: IsA<gio::OutputStream>, Q: IsA<gio::Cancellable>>(
442443
&self,
443444
stream: &P,
444445
type_: &str,
@@ -469,7 +470,6 @@ impl Pixbuf {
469470

470471
#[cfg(any(feature = "v2_36", feature = "dox"))]
471472
pub fn save_to_streamv_async<
472-
'a,
473473
P: IsA<gio::OutputStream>,
474474
Q: IsA<gio::Cancellable>,
475475
R: FnOnce(Result<(), Error>) + Send + 'static,

gdk/src/cairo_interaction.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub trait GdkContextExt {
4949
fn create_from_window<W: IsA<Window>>(window: &W) -> Context;
5050

5151
#[cfg(any(feature = "v3_16", feature = "dox"))]
52+
#[allow(clippy::too_many_arguments)]
5253
unsafe fn draw_from_gl<W: IsA<Window>>(
5354
&self,
5455
window: &W,

gdkx11/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ fn main() {
55
#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))]
66
fn manage_docs() {
77
extern crate lgpl_docs;
8-
const PATH: &'static str = "src";
9-
const IGNORES: &'static [&'static str] = &["lib.rs"];
8+
const PATH: &str = "src";
9+
const IGNORES: &[&str] = &["lib.rs"];
1010
lgpl_docs::purge(PATH, IGNORES);
1111
if cfg!(feature = "embed-lgpl-docs") {
1212
lgpl_docs::embed(lgpl_docs::Library::SourceView, PATH, IGNORES);

gio/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#![allow(clippy::type_complexity)]
66
#![allow(clippy::too_many_arguments)]
7+
#![allow(clippy::missing_safety_doc)]
78
#![allow(deprecated)]
89

910
#[macro_use]

gio/src/unix_output_stream.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
1414
use socket::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
1515

1616
impl UnixOutputStream {
17-
#[allow(clippy::missing_safety_doc)]
1817
pub unsafe fn new<T: IntoRawFd>(fd: T) -> UnixOutputStream {
1918
let fd = fd.into_raw_fd();
2019
let close_fd = true.to_glib();
@@ -30,7 +29,6 @@ impl AsRawFd for UnixOutputStream {
3029

3130
pub trait UnixOutputStreamExtManual: Sized {
3231
fn get_fd<T: FromRawFd>(&self) -> T;
33-
#[allow(clippy::missing_safety_doc)]
3432
unsafe fn set_close_fd(&self, close_fd: bool);
3533
}
3634

glib/src/object.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,6 @@ pub trait ObjectExt: ObjectType {
12821282
name: Option<&str>,
12831283
f: F,
12841284
) -> SignalHandlerId;
1285-
#[allow(clippy::missing_safety_doc)]
12861285
unsafe fn connect_notify_unsafe<F: Fn(&Self, &::ParamSpec)>(
12871286
&self,
12881287
name: Option<&str>,

0 commit comments

Comments
 (0)