fix clippy::toplevel_ref_arg and ::manual_map
This commit is contained in:
parent
e6e956dade
commit
543f8bc38c
12 changed files with 42 additions and 70 deletions
|
@ -1663,10 +1663,11 @@ impl SourceFile {
|
|||
|
||||
if let Some(ref src) = self.src {
|
||||
Some(Cow::from(get_until_newline(src, begin)))
|
||||
} else if let Some(src) = self.external_src.borrow().get_source() {
|
||||
Some(Cow::Owned(String::from(get_until_newline(src, begin))))
|
||||
} else {
|
||||
None
|
||||
self.external_src
|
||||
.borrow()
|
||||
.get_source()
|
||||
.map(|src| Cow::Owned(String::from(get_until_newline(src, begin))))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -906,10 +906,8 @@ impl SourceMap {
|
|||
|
||||
let snippet = if let Some(ref src) = local_begin.sf.src {
|
||||
Some(&src[start_index..])
|
||||
} else if let Some(src) = src.get_source() {
|
||||
Some(&src[start_index..])
|
||||
} else {
|
||||
None
|
||||
src.get_source().map(|src| &src[start_index..])
|
||||
};
|
||||
|
||||
match snippet {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue