From ea3e618b9404b9b991f19d60e2d0fb0e39ed0c13 Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Sat, 6 Apr 2024 21:13:17 +0200 Subject: [PATCH] Address nightly clippy lints --- gdnative-sys/build.rs | 67 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/gdnative-sys/build.rs b/gdnative-sys/build.rs index a4840f3fa..3ae08bb6a 100644 --- a/gdnative-sys/build.rs +++ b/gdnative-sys/build.rs @@ -254,7 +254,6 @@ mod header_binding { mod api_wrapper { use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote, ToTokens}; - use std::convert::AsRef; use std::fs::File; use std::io::Write as _; use std::path; @@ -392,44 +391,44 @@ mod api_wrapper { } } - // Used to convert [String, String] in JSON into the Argument struct. - impl Deserialize for Argument { - fn begin(out: &mut Option) -> &mut dyn de::Visitor { - impl de::Visitor for Place { - fn seq(&mut self) -> miniserde::Result> { - Ok(Box::new(ArgumentBuilder { - out: &mut self.out, - tuple: (None, None), - })) - } - } + impl de::Visitor for Place { + fn seq(&mut self) -> miniserde::Result> { + Ok(Box::new(ArgumentBuilder { + out: &mut self.out, + tuple: (None, None), + })) + } + } - struct ArgumentBuilder<'a> { - out: &'a mut Option, - tuple: (Option, Option), - } + struct ArgumentBuilder<'a> { + out: &'a mut Option, + tuple: (Option, Option), + } - impl<'a> de::Seq for ArgumentBuilder<'a> { - fn element(&mut self) -> miniserde::Result<&mut dyn de::Visitor> { - if self.tuple.0.is_none() { - Ok(Deserialize::begin(&mut self.tuple.0)) - } else if self.tuple.1.is_none() { - Ok(Deserialize::begin(&mut self.tuple.1)) - } else { - Err(miniserde::Error) - } - } + impl<'a> de::Seq for ArgumentBuilder<'a> { + fn element(&mut self) -> miniserde::Result<&mut dyn de::Visitor> { + if self.tuple.0.is_none() { + Ok(Deserialize::begin(&mut self.tuple.0)) + } else if self.tuple.1.is_none() { + Ok(Deserialize::begin(&mut self.tuple.1)) + } else { + Err(miniserde::Error) + } + } - fn finish(&mut self) -> miniserde::Result<()> { - if let (Some(a), Some(b)) = (self.tuple.0.take(), self.tuple.1.take()) { - *self.out = Some(Argument { type_: a, name: b }); - Ok(()) - } else { - Err(miniserde::Error) - } - } + fn finish(&mut self) -> miniserde::Result<()> { + if let (Some(a), Some(b)) = (self.tuple.0.take(), self.tuple.1.take()) { + *self.out = Some(Argument { type_: a, name: b }); + Ok(()) + } else { + Err(miniserde::Error) } + } + } + // Used to convert [String, String] in JSON into the Argument struct. + impl Deserialize for Argument { + fn begin(out: &mut Option) -> &mut dyn de::Visitor { Place::new(out) } }