Skip to content

Commit

Permalink
chore: 更新tip
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed May 5, 2024
1 parent a55d512 commit f3dc716
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/utils/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ fn find_scope_with_name_locally(name: &String, scope: Option<String>) -> Result<
}
}

Err(anyhow!("Error:Can't find scope for '{name}'"))
Err(if let Some(s) = scope {
anyhow!("Error:Can't locate '{name}' with scope '{s}'")
} else {
anyhow!("Error:Can't find scope for '{name}'")
})
}

fn find_scope_with_name_online(name: &String, scope: Option<String>) -> Result<(String, String)> {
Expand All @@ -97,7 +101,11 @@ fn find_scope_with_name_online(name: &String, scope: Option<String>) -> Result<(
}
}
}
Err(anyhow!("Error:Can't find scope for '{name}'"))
Err(if let Some(s) = scope {
anyhow!("Error:Can't locate '{name}' with scope '{s}'")
} else {
anyhow!("Error:Can't find scope for '{name}'")
})
}

pub fn find_scope_with_name(name: &String, scope: Option<String>) -> Result<(String, String)> {
Expand Down

0 comments on commit f3dc716

Please sign in to comment.