Skip to content

Commit

Permalink
Fix nightly clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed May 12, 2024
1 parent cf648fe commit 0507e8f
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/chunk/conversion_from_glib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
pub struct Mode {
pub typ: library::TypeId,
pub transfer: library::Transfer,
pub is_uninitialized: bool,
pub try_from_glib: TryFromGlib,
}

Expand All @@ -17,7 +16,6 @@ impl From<&parameter_ffi_call_out::Parameter> for Mode {
Mode {
typ: orig.typ,
transfer: orig.transfer,
is_uninitialized: orig.is_uninitialized,
try_from_glib: orig.try_from_glib.clone(),
}
}
Expand All @@ -28,7 +26,6 @@ impl From<&analysis::Parameter> for Mode {
Mode {
typ: orig.lib_par.typ,
transfer: orig.lib_par.transfer,
is_uninitialized: false,
try_from_glib: orig.try_from_glib.clone(),
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/codegen/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ trait FunctionLikeType {
fn doc_deprecated(&self) -> &Option<String>;
fn ret(&self) -> &Parameter;
fn parameters(&self) -> &[Parameter];
fn version(&self) -> &Option<Version>;
fn deprecated_version(&self) -> &Option<Version>;
}

Expand All @@ -82,9 +81,6 @@ macro_rules! impl_function_like_type {
fn parameters(&self) -> &[Parameter] {
&self.parameters
}
fn version(&self) -> &Option<Version> {
&self.version
}
fn deprecated_version(&self) -> &Option<Version> {
&self.deprecated_version
}
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/function_body_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Builder {
if !self.callbacks.is_empty() || !self.destroys.is_empty() {
for (pos, callback) in self.callbacks.iter().enumerate() {
let user_data_index = callback.user_data_index;
if group_by_user_data.get(&user_data_index).is_some() {
if group_by_user_data.contains_key(&user_data_index) {
continue;
}
let calls = self
Expand Down
5 changes: 1 addition & 4 deletions src/codegen/sys/statics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ pub fn only_for_gobject(w: &mut dyn Write) -> Result<()> {
}

pub fn only_for_gtk(w: &mut dyn Write) -> Result<()> {
let v = vec![
"",
"pub const GTK_ENTRY_BUFFER_MAX_SIZE: u16 = u16::MAX;",
];
let v = vec!["", "pub const GTK_ENTRY_BUFFER_MAX_SIZE: u16 = u16::MAX;"];

write_vec(w, &v)
}
2 changes: 1 addition & 1 deletion src/config/gobjects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ fn parse_object(
.lookup("align")
.and_then(Value::as_integer)
.and_then(|v| {
if v.count_ones() != 1 || v > i64::from(u32::max_value()) || v < 0 {
if v.count_ones() != 1 || v > i64::from(u32::MAX) || v < 0 {
warn!(
"`align` configuration must be a power of two of type u32, found {}",
v
Expand Down
4 changes: 0 additions & 4 deletions src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
pub use crate::config::{matchable::Matchable, parameter_matchable::ParameterMatchable};

pub trait AsStr {
fn as_str(&self) -> &str;
}

pub trait IntoString {
fn into_string(self) -> String;
}
Expand Down

0 comments on commit 0507e8f

Please sign in to comment.