all: fix clippy warnings
This commit is contained in:
parent
70912b47e4
commit
64664ca76e
5 changed files with 6 additions and 9 deletions
|
|
@ -749,10 +749,7 @@ impl Input {
|
||||||
println!("{prefix}{}:", device.id);
|
println!("{prefix}{}:", device.id);
|
||||||
println!("{prefix} name: {}", device.name);
|
println!("{prefix} name: {}", device.name);
|
||||||
if print_seat {
|
if print_seat {
|
||||||
let seat = match device.seat.as_deref() {
|
let seat = device.seat.as_deref().unwrap_or("<detached>");
|
||||||
Some(s) => s,
|
|
||||||
_ => "<detached>",
|
|
||||||
};
|
|
||||||
println!("{prefix} seat: {}", seat);
|
println!("{prefix} seat: {}", seat);
|
||||||
}
|
}
|
||||||
if let Some(v) = &device.syspath {
|
if let Some(v) = &device.syspath {
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ impl ClientMem {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn len(&self) -> usize {
|
pub fn len(&self) -> usize {
|
||||||
unsafe { (*self.data).len() }
|
self.data.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn offset(self: &Rc<Self>, offset: usize) -> ClientMemOffset {
|
pub fn offset(self: &Rc<Self>, offset: usize) -> ClientMemOffset {
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ impl Display for Mode {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
write!(f, "{} x {}", self.width, self.height)?;
|
write!(f, "{} x {}", self.width, self.height)?;
|
||||||
if let Some(rr) = self.refresh_rate {
|
if let Some(rr) = self.refresh_rate {
|
||||||
write!(f, " @ {}", rr)?;
|
write!(f, " @ {rr}")?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,12 @@ impl<E: Error> Display for SpannedError<'_, E> {
|
||||||
if let Some(cause) = &self.cause {
|
if let Some(cause) = &self.cause {
|
||||||
write!(f, "{}: ", Report::new(cause))?;
|
write!(f, "{}: ", Report::new(cause))?;
|
||||||
}
|
}
|
||||||
writeln!(f, "At line {}, column {}:", line_num, col_num)?;
|
writeln!(f, "At line {line_num}, column {col_num}:")?;
|
||||||
for _ in 0..=gutter {
|
for _ in 0..=gutter {
|
||||||
write!(f, " ")?;
|
write!(f, " ")?;
|
||||||
}
|
}
|
||||||
writeln!(f, "|")?;
|
writeln!(f, "|")?;
|
||||||
write!(f, "{} | ", line_num)?;
|
write!(f, "{line_num} | ")?;
|
||||||
writeln!(f, "{}", content.as_bstr())?;
|
writeln!(f, "{}", content.as_bstr())?;
|
||||||
for _ in 0..=gutter {
|
for _ in 0..=gutter {
|
||||||
write!(f, " ")?;
|
write!(f, " ")?;
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ impl<'a> Parser<'a, '_> {
|
||||||
if let Ok(n) = u32::from_str_radix(s, 16) {
|
if let Ok(n) = u32::from_str_radix(s, 16) {
|
||||||
if let Some(c) = char::from_u32(n) {
|
if let Some(c) = char::from_u32(n) {
|
||||||
pos += len;
|
pos += len;
|
||||||
let _ = write!(res, "{}", c);
|
let _ = write!(res, "{c}");
|
||||||
break 'unicode;
|
break 'unicode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue