fix check errors
This commit is contained in:
parent
dd5ccf5502
commit
ff458116b7
5 changed files with 11 additions and 11 deletions
|
|
@ -12,9 +12,9 @@ pub enum Color {
|
|||
impl Display for Color {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Color::RGB24(r, g, b) => write!(f, "#{:02X}{:02X}{:02X}FF", r, g, b),
|
||||
Color::RGBA32(r, g, b, a) => write!(f, "#{:02X}{:02X}{:02X}{:02X}", r, g, b, a),
|
||||
Color::W8(w) => write!(f, "#{:02X}{:02X}{:02X}FF", w, w, w),
|
||||
Color::RGB24(r, g, b) => write!(f, "#{r:02X}{g:02X}{b:02X}FF"),
|
||||
Color::RGBA32(r, g, b, a) => write!(f, "#{r:02X}{g:02X}{b:02X}{a:02X}"),
|
||||
Color::W8(w) => write!(f, "#{w:02X}{w:02X}{w:02X}FF"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,19 +60,19 @@ impl<T> Flut<T> {
|
|||
impl<T> Grid<Coordinate, T> for Flut<T> {
|
||||
fn get(&self, x: Coordinate, y: Coordinate) -> Option<&T> {
|
||||
self.index(x, y)
|
||||
.map(|idx| unsafe { &(*self.cells.get())[idx] })
|
||||
.map(|idx| unsafe { &(&(*self.cells.get()))[idx] })
|
||||
}
|
||||
|
||||
fn set(&self, x: Coordinate, y: Coordinate, value: T) {
|
||||
match self.index(x, y) {
|
||||
None => (),
|
||||
Some(idx) => unsafe { (*self.cells.get())[idx] = value },
|
||||
Some(idx) => unsafe { (&mut (*self.cells.get()))[idx] = value },
|
||||
}
|
||||
}
|
||||
|
||||
fn get_unchecked(&self, x: Coordinate, y: Coordinate) -> &T {
|
||||
let idx = y as usize * self.size_x + x as usize;
|
||||
unsafe { &(*self.cells.get())[idx] }
|
||||
unsafe { &(&(*self.cells.get()))[idx] }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,12 +113,12 @@ To set a pixel using RGB, use ({SET_PX_RGB_BIN:02X}) (u8 canvas) (x as u16_le) (
|
|||
match protocol {
|
||||
crate::ProtocolStatus::Enabled(proto) => {
|
||||
writer
|
||||
.write_all(format!("Enabled: {}\n", proto).as_bytes())
|
||||
.write_all(format!("Enabled: {proto}\n").as_bytes())
|
||||
.await?;
|
||||
}
|
||||
crate::ProtocolStatus::Disabled(proto) => {
|
||||
writer
|
||||
.write_all(format!("Disabled: {}\n", proto).as_bytes())
|
||||
.write_all(format!("Disabled: {proto}\n").as_bytes())
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,12 +153,12 @@ impl<W: AsyncWriteExt + std::marker::Unpin> Responder<W> for TextParser {
|
|||
match protocol {
|
||||
crate::ProtocolStatus::Enabled(proto) => {
|
||||
writer
|
||||
.write_all(format!("Enabled: {}\n", proto).as_bytes())
|
||||
.write_all(format!("Enabled: {proto}\n").as_bytes())
|
||||
.await?;
|
||||
}
|
||||
crate::ProtocolStatus::Disabled(proto) => {
|
||||
writer
|
||||
.write_all(format!("Disabled: {}\n", proto).as_bytes())
|
||||
.write_all(format!("Disabled: {proto}\n").as_bytes())
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ fn make_image_stream(
|
|||
fn make_stats() -> Message {
|
||||
let pixels: u64 = COUNTER.load(std::sync::atomic::Ordering::Relaxed);
|
||||
let clients: u64 = CLIENTS.load(std::sync::atomic::Ordering::Relaxed);
|
||||
format!("{{\"c\":{}, \"p\":{}}}", clients, pixels).into()
|
||||
format!("{{\"c\":{clients}, \"p\":{pixels}}}").into()
|
||||
}
|
||||
|
||||
async fn stats_stream(ws: WebSocketUpgrade) -> Response {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue