mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-18 16:20:18 +00:00
fix: no more Registering progress handler for token rustAnalyzer/Indexing failed.
This commit is contained in:
parent
ad131049c4
commit
cdfe5a8be0
2 changed files with 13 additions and 2 deletions
|
@ -179,6 +179,18 @@ where
|
|||
start..start + len
|
||||
}
|
||||
|
||||
pub fn defer<F: FnOnce()>(f: F) -> impl Drop {
|
||||
struct D<F: FnOnce()>(Option<F>);
|
||||
impl<F: FnOnce()> Drop for D<F> {
|
||||
fn drop(&mut self) {
|
||||
if let Some(f) = self.0.take() {
|
||||
f()
|
||||
}
|
||||
}
|
||||
}
|
||||
D(Some(f))
|
||||
}
|
||||
|
||||
#[repr(transparent)]
|
||||
pub struct JodChild(pub std::process::Child);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue