Skip to content

Commit

Permalink
Fix some warnings and remove dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
H-M-H committed Sep 25, 2024
1 parent f5b17bb commit ffa05da
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 61 deletions.
50 changes: 0 additions & 50 deletions src/capturable/autopilot.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/capturable/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pub mod autopilot;

use std::boxed::Box;
use std::error::Error;
use tracing::warn;
Expand Down
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::net::IpAddr;
use std::str::FromStr;
use std::{fs, path::PathBuf};

use clap::Parser;
Expand Down
2 changes: 1 addition & 1 deletion src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ pub fn run(config: &Config, log_receiver: mpsc::Receiver<String>) {
image
.write_to(&mut cursor, image::ImageFormat::Png)
.unwrap();
let png = fltk::image::PngImage::from_data(&buf).unwrap();
let png = PngImage::from_data(&buf).unwrap();
qr_frame.set_image(Some(png));
};

Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ fn main() {

if conf.no_gui {
let mut weylus = crate::weylus::Weylus::new();
weylus.start(&conf, |msg| {
if let crate::web::Web2UiMessage::UInputInaccessible = msg {
warn!(std::include_str!("strings/uinput_error.txt"));
weylus.start(&conf, |msg| match msg {
web::Web2UiMessage::UInputInaccessible => {
warn!(std::include_str!("strings/uinput_error.txt"))
}
});
#[cfg(unix)]
Expand Down
3 changes: 0 additions & 3 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,4 @@ pub trait WeylusSender {

pub trait WeylusReceiver: Iterator<Item = Result<MessageInbound, Self::Error>> {
type Error: std::error::Error;
fn recv_message(&mut self) -> Option<Result<MessageInbound, Self::Error>> {
self.next()
}
}
2 changes: 1 addition & 1 deletion src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use fastwebsockets::{FragmentCollectorRead, Frame, OpCode, WebSocket, WebSocketE
use hyper::upgrade::Upgraded;
use hyper_util::rt::TokioIo;
use std::convert::Infallible;
use std::sync::mpsc::{RecvTimeoutError, SendError};
use std::sync::mpsc::RecvTimeoutError;
use std::sync::{mpsc, Arc};
use std::thread::{spawn, JoinHandle};
use std::time::{Duration, Instant};
Expand Down

0 comments on commit ffa05da

Please sign in to comment.