mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Add semicolons for consistency
`clippy::semicolon_if_nothing_returned`
This commit is contained in:
parent
60c5449120
commit
55c0b86cde
46 changed files with 151 additions and 151 deletions
|
|
@ -45,7 +45,7 @@ fn to_snake_case<F: Fn(&char) -> char>(s: &str, change_case: F) -> String {
|
|||
if c.is_ascii_uppercase() && prev {
|
||||
// This check is required to not translate `Weird_Case` into `weird__case`.
|
||||
if !buf.ends_with('_') {
|
||||
buf.push('_')
|
||||
buf.push('_');
|
||||
}
|
||||
}
|
||||
prev = true;
|
||||
|
|
@ -60,7 +60,7 @@ pub fn replace(buf: &mut String, from: char, to: &str) {
|
|||
return;
|
||||
}
|
||||
// FIXME: do this in place.
|
||||
*buf = buf.replace(from, to)
|
||||
*buf = buf.replace(from, to);
|
||||
}
|
||||
|
||||
pub fn trim_indent(mut text: &str) -> String {
|
||||
|
|
@ -101,7 +101,7 @@ pub fn defer<F: FnOnce()>(f: F) -> impl Drop {
|
|||
impl<F: FnOnce()> Drop for D<F> {
|
||||
fn drop(&mut self) {
|
||||
if let Some(f) = self.0.take() {
|
||||
f()
|
||||
f();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,19 +25,19 @@ impl PanicContext {
|
|||
if !ctx.is_empty() {
|
||||
eprintln!("Panic context:");
|
||||
for frame in ctx.iter() {
|
||||
eprintln!("> {}\n", frame)
|
||||
eprintln!("> {}\n", frame);
|
||||
}
|
||||
}
|
||||
default_hook(panic_info)
|
||||
})
|
||||
default_hook(panic_info);
|
||||
});
|
||||
};
|
||||
panic::set_hook(Box::new(hook))
|
||||
panic::set_hook(Box::new(hook));
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for PanicContext {
|
||||
fn drop(&mut self) {
|
||||
with_ctx(|ctx| assert!(ctx.pop().is_some()))
|
||||
with_ctx(|ctx| assert!(ctx.pop().is_some()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -45,5 +45,5 @@ fn with_ctx(f: impl FnOnce(&mut Vec<String>)) {
|
|||
thread_local! {
|
||||
static CTX: RefCell<Vec<String>> = RefCell::new(Vec::new());
|
||||
}
|
||||
CTX.with(|ctx| f(&mut *ctx.borrow_mut()))
|
||||
CTX.with(|ctx| f(&mut *ctx.borrow_mut()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ pub fn streaming_output(
|
|||
};
|
||||
for line in String::from_utf8_lossy(new_lines).lines() {
|
||||
if is_out {
|
||||
on_stdout_line(line)
|
||||
on_stdout_line(line);
|
||||
} else {
|
||||
on_stderr_line(line)
|
||||
on_stderr_line(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue