Unnamed repository; edit this file 'description' to name the repository.
unwrap unnecessary result return type
| -rw-r--r-- | crates/ide/src/lib.rs | 2 | ||||
| -rw-r--r-- | crates/ide/src/view_crate_graph.rs | 4 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/handlers/request.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index f3e51e1919..270998cdf7 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -414,7 +414,7 @@ impl Analysis { } /// Renders the crate graph to GraphViz "dot" syntax. - pub fn view_crate_graph(&self, full: bool) -> Cancellable<Result<String, String>> { + pub fn view_crate_graph(&self, full: bool) -> Cancellable<String> { self.with_db(|db| view_crate_graph::view_crate_graph(db, full)) } diff --git a/crates/ide/src/view_crate_graph.rs b/crates/ide/src/view_crate_graph.rs index e1670b7187..ecfdd09b24 100644 --- a/crates/ide/src/view_crate_graph.rs +++ b/crates/ide/src/view_crate_graph.rs @@ -16,7 +16,7 @@ use ide_db::{ // | Editor | Action Name | // |---------|-------------| // | VS Code | **rust-analyzer: View Crate Graph** | -pub(crate) fn view_crate_graph(db: &RootDatabase, full: bool) -> Result<String, String> { +pub(crate) fn view_crate_graph(db: &RootDatabase, full: bool) -> String { let all_crates = all_crates(db); let crates_to_render = all_crates .iter() @@ -36,7 +36,7 @@ pub(crate) fn view_crate_graph(db: &RootDatabase, full: bool) -> Result<String, let mut dot = Vec::new(); dot::render(&graph, &mut dot).unwrap(); - Ok(String::from_utf8(dot).unwrap()) + String::from_utf8(dot).unwrap() } struct DotCrateGraph<'db> { diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs index 9c2e0a5f32..86516b6079 100644 --- a/crates/rust-analyzer/src/handlers/request.rs +++ b/crates/rust-analyzer/src/handlers/request.rs @@ -332,7 +332,7 @@ pub(crate) fn handle_view_crate_graph( params: ViewCrateGraphParams, ) -> anyhow::Result<String> { let _p = tracing::info_span!("handle_view_crate_graph").entered(); - let dot = snap.analysis.view_crate_graph(params.full)?.map_err(anyhow::Error::msg)?; + let dot = snap.analysis.view_crate_graph(params.full)?; Ok(dot) } |