Use From when Into can't auto-infer type
This commit is contained in:
parent
ddf2883e4f
commit
d76afe92f0
2 changed files with 2 additions and 4 deletions
|
@ -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())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue