Unnest a conditional
This commit is contained in:
parent
d968443074
commit
aa67245743
|
@ -187,12 +187,10 @@ fn parse_include_path(path: &str) -> LinkType<'static> {
|
|||
let start = if let Some(value) = next_element.and_then(|s| s.parse::<usize>().ok()) {
|
||||
// subtract 1 since line numbers usually begin with 1
|
||||
Some(value.saturating_sub(1))
|
||||
} else if let Some(anchor) = next_element {
|
||||
if anchor == "" {
|
||||
} else if let Some("") = next_element {
|
||||
None
|
||||
} else {
|
||||
} else if let Some(anchor) = next_element {
|
||||
return LinkType::IncludeAnchor(path, String::from(anchor));
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue