We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31b411f commit ef321d6Copy full SHA for ef321d6
src/file_assoc.rs
@@ -14,10 +14,10 @@ pub fn install_file_association() -> MainResult<()> {
14
15
// We have to remove the `\\?\` prefix because, if we don't, the shell freaks out.
16
let rust_script_path = rust_script_path.to_string_lossy();
17
- let rust_script_path = if rust_script_path.starts_with(r#"\\?\"#) {
18
- &rust_script_path[4..]
+ let rust_script_path = if let Some(stripped) = rust_script_path.strip_prefix(r#"\\?\"#) {
+ stripped
19
} else {
20
- &rust_script_path[..]
+ rust_script_path
21
};
22
23
let res = (|| -> io::Result<()> {
0 commit comments