File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1336,12 +1336,12 @@ pub(crate) fn handle_open_cargo_toml(
1336
1336
) -> Result < Option < lsp_types:: GotoDefinitionResponse > > {
1337
1337
let _p = profile:: span ( "handle_open_cargo_toml" ) ;
1338
1338
let file_id = from_proto:: file_id ( & snap, & params. text_document . uri ) ?;
1339
- let maybe_cargo_spec = CargoTargetSpec :: for_file ( & snap, file_id) ?;
1340
- if maybe_cargo_spec. is_none ( ) {
1341
- return Ok ( None ) ;
1342
- }
1343
1339
1344
- let cargo_spec = maybe_cargo_spec. unwrap ( ) ;
1340
+ let cargo_spec = match CargoTargetSpec :: for_file ( & snap, file_id) ? {
1341
+ Some ( it) => it,
1342
+ None => return Ok ( None ) ,
1343
+ } ;
1344
+
1345
1345
let cargo_toml_path = cargo_spec. workspace_root . join ( "Cargo.toml" ) ;
1346
1346
if !cargo_toml_path. exists ( ) {
1347
1347
return Ok ( None ) ;
You can’t perform that action at this time.
0 commit comments