Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
payload committed Aug 19, 2023
1 parent 975971a commit 6c356b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions examples/iced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::iter::repeat;
use std::sync::mpsc::{channel, Receiver, Sender, TryRecvError};
use std::time::Instant;

use iced::widget::{column, container, image, slider, text};
use iced::widget::{column, container, image, text};
use iced::{
executor, window, Alignment, Application, Command, Element, Length, Settings, Subscription,
Theme,
Expand All @@ -14,8 +14,6 @@ pub fn main() -> iced::Result {
}

struct Example {
radius: [f32; 4],
border_width: f32,
cameras: Vec<CameraInfo>,
#[allow(unused)]
end_camera: Sender<()>,
Expand Down Expand Up @@ -63,8 +61,6 @@ impl Application for Example {

(
Self {
radius: [50.0; 4],
border_width: 0.0,
cameras,
end_camera,
camera_frame,
Expand All @@ -87,8 +83,6 @@ impl Application for Example {
}

fn update(&mut self, message: Message) -> Command<Message> {
let [tl, tr, br, bl] = self.radius;

match message {
Message::Tick(_instant) => {
while let Ok(((w, h), pixels)) = self.camera_frame.try_recv() {
Expand All @@ -101,8 +95,6 @@ impl Application for Example {
}

fn view(&self) -> Element<Message> {
let [tl, tr, br, bl] = self.radius;

let mut column = column(Vec::new());

column = column.push(image(self.current_frame.clone()));
Expand Down
2 changes: 1 addition & 1 deletion tests/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ fn change_device() {
fn enumerate_cameras() {
let camera_infos = Camera::enumerate_cameras();
dbg!(&camera_infos);
assert!(camera_infos.len() > 0);
assert!(!camera_infos.is_empty());
}

0 comments on commit 6c356b2

Please sign in to comment.