fix: prefer from trait over into

This commit is contained in:
Gabriele Musco 2024-08-27 23:48:30 +02:00
commit e3ee44b1c4
2 changed files with 12 additions and 11 deletions

View file

@ -139,6 +139,7 @@ pub fn set_current_active_runtime_to_profile(profile: &Profile) -> anyhow::Resul
let dest = get_active_runtime_json_path(); let dest = get_active_runtime_json_path();
set_file_readonly(&dest, false)?; set_file_readonly(&dest, false)?;
backup_steam_active_runtime(); backup_steam_active_runtime();
// TODO: need to escape path spaces here?
let pfx = profile.clone().prefix; let pfx = profile.clone().prefix;
let mut ar = build_profile_active_runtime(profile)?; let mut ar = build_profile_active_runtime(profile)?;
// hack: relativize libopenxr_monado.so path for system installs // hack: relativize libopenxr_monado.so path for system installs

View file

@ -62,11 +62,11 @@ impl From<u32> for XRServiceType {
} }
} }
impl Into<u32> for XRServiceType { impl From<&XRServiceType> for u32 {
fn into(self) -> u32 { fn from(value: &XRServiceType) -> Self {
match self { match value {
Self::Monado => 0, XRServiceType::Monado => 0,
Self::Wivrn => 1, XRServiceType::Wivrn => 1,
} }
} }
} }
@ -215,12 +215,12 @@ impl From<u32> for LighthouseDriver {
} }
} }
impl Into<u32> for LighthouseDriver { impl From<&LighthouseDriver> for u32 {
fn into(self) -> u32 { fn from(value: &LighthouseDriver) -> Self {
match self { match value {
Self::Vive => 0, LighthouseDriver::Vive => 0,
Self::Survive => 1, LighthouseDriver::Survive => 1,
Self::SteamVR => 2, LighthouseDriver::SteamVR => 2,
} }
} }
} }