Remove unneeded maybe!
(#7576)
This PR removes an unneeded `maybe!` from `get_permalink_to_line`. As this is a `Result`-returning function, we don't need the inner level of wrapping. Release Notes: - N/A
This commit is contained in:
parent
b25044393e
commit
b77d452b90
1 changed files with 35 additions and 38 deletions
|
@ -8396,7 +8396,6 @@ impl Editor {
|
||||||
fn get_permalink_to_line(&mut self, cx: &mut ViewContext<Self>) -> Result<url::Url> {
|
fn get_permalink_to_line(&mut self, cx: &mut ViewContext<Self>) -> Result<url::Url> {
|
||||||
use git::permalink::{build_permalink, BuildPermalinkParams};
|
use git::permalink::{build_permalink, BuildPermalinkParams};
|
||||||
|
|
||||||
let permalink = maybe!({
|
|
||||||
let project = self.project.clone().ok_or_else(|| anyhow!("no project"))?;
|
let project = self.project.clone().ok_or_else(|| anyhow!("no project"))?;
|
||||||
let project = project.read(cx);
|
let project = project.read(cx);
|
||||||
|
|
||||||
|
@ -8438,8 +8437,6 @@ impl Editor {
|
||||||
path: &path,
|
path: &path,
|
||||||
selection: selection.map(|selection| selection.range()),
|
selection: selection.map(|selection| selection.range()),
|
||||||
})
|
})
|
||||||
});
|
|
||||||
permalink
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn copy_permalink_to_line(&mut self, _: &CopyPermalinkToLine, cx: &mut ViewContext<Self>) {
|
pub fn copy_permalink_to_line(&mut self, _: &CopyPermalinkToLine, cx: &mut ViewContext<Self>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue