mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:17:13 +00:00
Merge pull request #20126 from Wilfred/no_unwrap_in_discover_projects
fix: Avoid .unwrap() when running the discover command
This commit is contained in:
commit
fce1f41462
@ -783,9 +783,14 @@ impl GlobalState {
|
||||
DiscoverProjectParam::Path(it) => DiscoverArgument::Path(it),
|
||||
};
|
||||
|
||||
let handle =
|
||||
discover.spawn(arg, &std::env::current_dir().unwrap()).unwrap();
|
||||
self.discover_handle = Some(handle);
|
||||
let handle = discover.spawn(
|
||||
arg,
|
||||
&std::env::current_dir()
|
||||
.expect("Failed to get cwd during project discovery"),
|
||||
);
|
||||
self.discover_handle = Some(handle.unwrap_or_else(|e| {
|
||||
panic!("Failed to spawn project discovery command: {e}")
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user