Use From when Into can't auto-infer type

This commit is contained in:
Michael Bradley 2025-07-06 17:58:18 -04:00
parent ddf2883e4f
commit d76afe92f0
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4
2 changed files with 2 additions and 4 deletions

View file

@ -62,7 +62,6 @@ impl TryFrom<Vec<u8>> for Seed {
type Error = TryFromSliceError; type Error = TryFromSliceError;
fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> { fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
let bytes: [u8; 8] = value.as_slice().try_into()?; Ok(TryInto::<[u8; 8]>::try_into(value.as_slice())?.into())
Ok(bytes.into())
} }
} }

View file

@ -24,8 +24,7 @@ pub fn setup_seed_ui(mut commands: Commands) {
pub fn update_seed_ui(seed: Option<Single<&Seed>>, text: Query<&mut TextSpan, With<SeedUI>>) { pub fn update_seed_ui(seed: Option<Single<&Seed>>, text: Query<&mut TextSpan, With<SeedUI>>) {
if let Some(value) = seed { if let Some(value) = seed {
for mut span in text { for mut span in text {
let number: u64 = (**value).into(); **span = format!("{}", u64::from(**value));
**span = format!("{}", number);
} }
} }
} }