Browse Source

Clippy

pull/78/head
TechiePi 2 years ago
parent
commit
0a6654aa55
  1. 2
      ctru-rs/src/applets/mii_selector.rs
  2. 4
      ctru-rs/src/mii.rs

2
ctru-rs/src/applets/mii_selector.rs

@ -160,7 +160,7 @@ impl MiiSelectorReturn {
impl From<Box<ctru_sys::MiiSelectorReturn>> for MiiSelectorReturn { impl From<Box<ctru_sys::MiiSelectorReturn>> for MiiSelectorReturn {
fn from(ret: Box<ctru_sys::MiiSelectorReturn>) -> Self { fn from(ret: Box<ctru_sys::MiiSelectorReturn>) -> Self {
let checksum = ret.checksum; let checksum = ret.checksum;
let raw_mii_data = ret.mii._bindgen_opaque_blob.clone(); let raw_mii_data = ret.mii._bindgen_opaque_blob;
let no_mii_selected = ret.no_mii_selected; let no_mii_selected = ret.no_mii_selected;
let guest_mii_index_clone = ret.guest_mii_index; let guest_mii_index_clone = ret.guest_mii_index;
let mut guest_mii_name = ret.guest_mii_name; let mut guest_mii_name = ret.guest_mii_name;

4
ctru-rs/src/mii.rs

@ -417,11 +417,11 @@ fn utf16_byte_pairs_to_string(data: &[u8]) -> String {
.collect::<Vec<&[u8]>>() .collect::<Vec<&[u8]>>()
.iter() .iter()
.map(|v| { .map(|v| {
u16::from_le_bytes([*v.get(0).unwrap_or(&0), *v.get(1).unwrap_or(&0)]) u16::from_le_bytes([*v.first().unwrap_or(&0), *v.get(1).unwrap_or(&0)])
}) })
.collect::<Vec<u16>>(); .collect::<Vec<u16>>();
String::from_utf16(raw_utf16_composed.as_slice()).unwrap().replace("\0", "") String::from_utf16(raw_utf16_composed.as_slice()).unwrap().replace('\0', "")
} }
/// Gets the values from the slice and concatenates them /// Gets the values from the slice and concatenates them

Loading…
Cancel
Save