Skip to content

Commit

Permalink
chore: Cleanup around irrefutable let patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
WillLillis committed Nov 5, 2024
1 parent 712c9e6 commit 99cdf51
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions asm-lsp/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1872,10 +1872,7 @@ fn get_project_root(params: &InitializeParams) -> Option<PathBuf> {
if let Some(folders) = &params.workspace_folders {
// if there's multiple, just visit in order until we find a valid folder
for folder in folders {
#[allow(irrefutable_let_patterns)] // TODO: Remove once CI is bumped past 1.82
let Ok(parsed) = PathBuf::from_str(folder.uri.path().as_str()) else {
unreachable!()
};
let Ok(parsed) = PathBuf::from_str(folder.uri.path().as_str());
if let Ok(parsed_path) = parsed.canonicalize() {
info!("Detected project root: {}", parsed_path.display());
return Some(parsed_path);
Expand All @@ -1886,10 +1883,7 @@ fn get_project_root(params: &InitializeParams) -> Option<PathBuf> {
// if workspace folders weren't set or came up empty, we check the root_uri
#[allow(deprecated)]
if let Some(root_uri) = &params.root_uri {
#[allow(irrefutable_let_patterns)] // TODO: Remove once CI is bumped past 1.82
let Ok(parsed) = PathBuf::from_str(root_uri.path().as_str()) else {
unreachable!()
};
let Ok(parsed) = PathBuf::from_str(root_uri.path().as_str());
if let Ok(parsed_path) = parsed.canonicalize() {
info!("Detected project root: {}", parsed_path.display());
return Some(parsed_path);
Expand All @@ -1899,10 +1893,7 @@ fn get_project_root(params: &InitializeParams) -> Option<PathBuf> {
// if both `workspace_folders` and `root_uri` weren't set or came up empty, we check the root_path
#[allow(deprecated)]
if let Some(root_path) = &params.root_path {
#[allow(irrefutable_let_patterns)] // TODO: Remove once CI is bumped past 1.82
let Ok(parsed) = PathBuf::from_str(root_path.as_str()) else {
unreachable!()
};
let Ok(parsed) = PathBuf::from_str(root_path.as_str());
if let Ok(parsed_path) = parsed.canonicalize() {
return Some(parsed_path);
}
Expand Down

0 comments on commit 99cdf51

Please sign in to comment.