1 Apr
2025
1 Apr
'25
5:53 p.m.
Jinoh Kang (@iamahuman) commented about tools/wine/wine.rs:
+ Target { cpu, platform } +} + +fn get_arch_dir(target: &Target) -> String { + let cpu_names = [ + ("i386", "i386"), + ("x86_64", "x86_64"), + ("arm", "arm"), + ("aarch64", "aarch64"), + ]; + + let cpu_name = cpu_names + .iter() + .find(|&&(key, _)| key == target.cpu) + .map(|&(_, name)| name); + if let Some(name) = cpu_name { You can simply panic here. Why complicate matters?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7717#note_99609