fix clippy::needless_borrow

This commit is contained in:
Matthias Krüger 2022-03-12 13:04:13 +01:00
parent ff7e057dca
commit 7912e33ed6
36 changed files with 74 additions and 77 deletions

View file

@ -74,14 +74,11 @@ pub trait Message: Serialize + DeserializeOwned {
impl Message for Request {}
impl Message for Response {}
fn read_json<'a>(
inp: &mut impl BufRead,
mut buf: &'a mut String,
) -> io::Result<Option<&'a String>> {
fn read_json<'a>(inp: &mut impl BufRead, buf: &'a mut String) -> io::Result<Option<&'a String>> {
loop {
buf.clear();
inp.read_line(&mut buf)?;
inp.read_line(buf)?;
buf.pop(); // Remove trailing '\n'
if buf.is_empty() {