mirror of
https://git.proxmox.com/git/perlmod
synced 2025-10-04 13:22:15 +00:00
clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
02e4344e7e
commit
f8b49fc1be
@ -78,7 +78,7 @@ pub fn handle_function(
|
||||
}
|
||||
|
||||
let name = func.sig.ident.clone();
|
||||
let export_public = export_public.then(|| &func.vis);
|
||||
let export_public = export_public.then_some(&func.vis);
|
||||
let xs_name = attr
|
||||
.xs_name
|
||||
.clone()
|
||||
|
@ -413,7 +413,7 @@ impl ScalarRef {
|
||||
/// If `blessed` is true and the value is a blessed reference, the package name will be
|
||||
/// returned, otherwise the scalar type (`"SCALAR"`, `"ARRAY"`, ...) will be returned.
|
||||
pub fn reftype(&self, blessed: bool) -> &'static str {
|
||||
let ptr = unsafe { ffi::RSPL_sv_reftype(self.sv(), if blessed { 1 } else { 0 }) };
|
||||
let ptr = unsafe { ffi::RSPL_sv_reftype(self.sv(), i32::from(blessed)) };
|
||||
|
||||
if ptr.is_null() {
|
||||
"<UNKNOWN>"
|
||||
|
@ -64,7 +64,7 @@ impl<'a> ser::Serializer for &'a mut Serializer {
|
||||
type SerializeStructVariant = SerVariant<SerHash>;
|
||||
|
||||
fn serialize_bool(self, v: bool) -> Result<Value, Error> {
|
||||
Ok(Value::new_uint(if v { 1 } else { 0 }))
|
||||
Ok(Value::new_uint(usize::from(v)))
|
||||
}
|
||||
|
||||
fn serialize_i8(self, v: i8) -> Result<Value, Error> {
|
||||
|
@ -527,7 +527,7 @@ impl<'de> Deserialize<'de> for Value {
|
||||
|
||||
#[inline]
|
||||
fn visit_bool<E>(self, value: bool) -> Result<Value, E> {
|
||||
Ok(Value::new_int(if value { 1 } else { 0 }))
|
||||
Ok(Value::new_int(isize::from(value)))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user