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();
set_file_readonly(&dest, false)?;
backup_steam_active_runtime();
// TODO: need to escape path spaces here?
let pfx = profile.clone().prefix;
let mut ar = build_profile_active_runtime(profile)?;
// 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 {
fn into(self) -> u32 {
match self {
Self::Monado => 0,
Self::Wivrn => 1,
impl From<&XRServiceType> for u32 {
fn from(value: &XRServiceType) -> Self {
match value {
XRServiceType::Monado => 0,
XRServiceType::Wivrn => 1,
}
}
}
@ -215,12 +215,12 @@ impl From<u32> for LighthouseDriver {
}
}
impl Into<u32> for LighthouseDriver {
fn into(self) -> u32 {
match self {
Self::Vive => 0,
Self::Survive => 1,
Self::SteamVR => 2,
impl From<&LighthouseDriver> for u32 {
fn from(value: &LighthouseDriver) -> Self {
match value {
LighthouseDriver::Vive => 0,
LighthouseDriver::Survive => 1,
LighthouseDriver::SteamVR => 2,
}
}
}