diff --git a/src/core/file.rs b/src/core/file.rs index 5b8f917..39c9fc5 100644 --- a/src/core/file.rs +++ b/src/core/file.rs @@ -118,7 +118,7 @@ pub async fn save( tar.finish().into_diagnostic() } -async fn clear_temp_dir(temp_dir: &Path) -> Result<()> { +async fn clear_temp_dir(_temp_dir: &Path) -> Result<()> { todo!() } diff --git a/src/core/images.rs b/src/core/images.rs index 7e37607..9ded9c2 100644 --- a/src/core/images.rs +++ b/src/core/images.rs @@ -48,7 +48,7 @@ impl From<&Path> for Image { } impl From<&Image> for Value { - fn from(value: &Image) -> Self { + fn from(_value: &Image) -> Self { Self::List(vec![Self::Symbol(Symbol("image".into()))]) } } diff --git a/src/core/kinds.rs b/src/core/kinds.rs index 9aa3768..234a1e1 100644 --- a/src/core/kinds.rs +++ b/src/core/kinds.rs @@ -53,7 +53,7 @@ impl ServiceItemKind { ServiceItemKind::Presentation(presentation) => { presentation.title.to_string() } - ServiceItemKind::Content(slide) => todo!(), + ServiceItemKind::Content(_slide) => todo!(), } } @@ -65,7 +65,7 @@ impl ServiceItemKind { ServiceItemKind::Presentation(presentation) => { presentation.to_service_item() } - ServiceItemKind::Content(slide) => { + ServiceItemKind::Content(_slide) => { todo!() } } diff --git a/src/core/model.rs b/src/core/model.rs index 2b0bd7c..25affdc 100644 --- a/src/core/model.rs +++ b/src/core/model.rs @@ -1,8 +1,4 @@ -use std::{ - borrow::Cow, - mem::replace, - path::{Path, PathBuf}, -}; +use std::{borrow::Cow, mem::replace, path::PathBuf}; use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes}; use miette::{IntoDiagnostic, Result, miette}; @@ -32,7 +28,7 @@ pub enum LibraryKind { pub struct KindWrapper(pub (LibraryKind, i32)); impl From for LibraryKind { - fn from(value: PathBuf) -> Self { + fn from(_value: PathBuf) -> Self { todo!() } } @@ -83,7 +79,7 @@ impl Model { Ok(()) } - pub fn add_to_db(&mut self, item: T) -> Result<()> { + pub fn add_to_db(&mut self, _item: T) -> Result<()> { todo!() } diff --git a/src/core/service_items.rs b/src/core/service_items.rs index 250d16d..6a5536f 100644 --- a/src/core/service_items.rs +++ b/src/core/service_items.rs @@ -174,7 +174,7 @@ impl From<&Value> for ServiceItem { _ => false, }) .map_or_else(|| 1, |pos| pos + 1); - if let Some(content) = + if let Some(_content) = list.iter().position(|v| match v { Value::List(list) if list.iter().next() diff --git a/src/core/slide.rs b/src/core/slide.rs index 9ed1a3d..09bb75f 100644 --- a/src/core/slide.rs +++ b/src/core/slide.rs @@ -180,7 +180,7 @@ impl TryFrom for Background { _ => Err(ParseError::NonBackgroundFile), } } - Err(e) => { + Err(_e) => { // error!("Couldn't canonicalize: {e} {:?}", path); Err(ParseError::CannotCanonicalize) } @@ -260,7 +260,7 @@ impl From for BackgroundKind { } impl From<&Slide> for Value { - fn from(value: &Slide) -> Self { + fn from(_value: &Slide) -> Self { Self::List(vec![Self::Symbol(Symbol("slide".into()))]) } } @@ -485,7 +485,7 @@ fn lisp_to_text(lisp: &Value) -> impl Into { pub fn lisp_to_background(lisp: &Value) -> Background { match lisp { Value::List(list) => { - let kind = list[0].clone(); + let _kind = list[0].clone(); if let Some(source) = list.iter().position(|v| { v == &Value::Keyword(Keyword::from("source")) }) { @@ -749,10 +749,10 @@ mod test { let slide = read_to_string("./test_presentation.ron") .expect("Problem getting file read"); match ron::from_str::>(&slide) { - Ok(s) => { + Ok(_s) => { assert!(true) } - Err(e) => { + Err(_e) => { assert!(false) } } diff --git a/src/lisp.rs b/src/lisp.rs index b120fb6..4f54005 100644 --- a/src/lisp.rs +++ b/src/lisp.rs @@ -43,7 +43,7 @@ mod test { images::Image, kinds::ServiceItemKind, service_items::ServiceTrait, - slide::{Background, Slide, SlideBuilder, TextAlignment}, + slide::{Background, TextAlignment}, songs::Song, videos::Video, }; diff --git a/src/ui/library.rs b/src/ui/library.rs index 9f5051a..5cdbcff 100644 --- a/src/ui/library.rs +++ b/src/ui/library.rs @@ -161,7 +161,7 @@ impl<'a> Library { self.library_open.unwrap_or(LibraryKind::Song); match kind { LibraryKind::Song => { - let song = Song::default(); + let _song = Song::default(); let task = Task::future(self.db.acquire()).and_then(move |db| { Task::perform(add_song_to_db(db), move |res| { match res { @@ -652,7 +652,7 @@ impl<'a> Library { let mut tasks = Vec::new(); let last_item = &items.last(); let after_task = match last_item { - Some(ServiceItemKind::Image(image)) => { + Some(ServiceItemKind::Image(_image)) => { Task::done(Message::OpenItem(Some(( LibraryKind::Image, self.image_library.items.len() as i32 - 1, @@ -801,7 +801,7 @@ impl<'a> Library { }; error!(?e); } - ServiceItemKind::Content(slide) => todo!(), + ServiceItemKind::Content(_slide) => todo!(), } } return Action::Task( @@ -860,7 +860,7 @@ impl<'a> Library { warn!(?mimes); Message::None }) - .on_finish(|mime, data, action, _, _| { + .on_finish(|mime, data, _action, _, _| { // warn!(?mime, ?data, ?action); match mime.as_str() { "text/uri-list" => { diff --git a/src/ui/presentation_editor.rs b/src/ui/presentation_editor.rs index 2eed9dc..cecb4f3 100644 --- a/src/ui/presentation_editor.rs +++ b/src/ui/presentation_editor.rs @@ -1,7 +1,7 @@ use std::{ collections::HashMap, io, - ops::{Range, RangeBounds}, + ops::RangeBounds, path::{Path, PathBuf}, }; diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index e5300be..1392fe4 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -798,7 +798,7 @@ impl Presenter { }, ); let scrollable = - scrollable(container(Row::from_vec(items)).style(|t| { + scrollable(container(Row::from_vec(items)).style(|_t| { let style = container::Style::default(); style.border(Border::default().width(2)) })) diff --git a/src/ui/service.rs b/src/ui/service.rs index ceca63c..85d61b5 100644 --- a/src/ui/service.rs +++ b/src/ui/service.rs @@ -165,10 +165,10 @@ impl event: Event, layout: layout::Layout<'_>, cursor: mouse::Cursor, - renderer: &cosmic::Renderer, - clipboard: &mut dyn Clipboard, + _renderer: &cosmic::Renderer, + _clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, - viewport: &Rectangle, + _viewport: &Rectangle, ) -> event::Status { let state = tree.state.downcast_mut::(); @@ -205,7 +205,7 @@ impl { shell.publish(on_start.clone()) } - let offset = Vector::new( + let _offset = Vector::new( left_pressed_position.x - layout.bounds().x, left_pressed_position.y @@ -278,16 +278,16 @@ impl fn draw( &self, - tree: &Tree, - renderer: &mut cosmic::Renderer, - theme: &cosmic::Theme, - renderer_style: &renderer::Style, - layout: layout::Layout<'_>, - cursor_position: mouse::Cursor, - viewport: &Rectangle, + _tree: &Tree, + _renderer: &mut cosmic::Renderer, + _theme: &cosmic::Theme, + _renderer_style: &renderer::Style, + _layout: layout::Layout<'_>, + _cursor_position: mouse::Cursor, + _viewport: &Rectangle, ) { // let state = tree.state.downcast_mut::(); - for item in self.service {} + for _item in self.service {} } // fn overlay<'b>( diff --git a/src/ui/slide_editor.rs b/src/ui/slide_editor.rs index fd3de5b..703473c 100644 --- a/src/ui/slide_editor.rs +++ b/src/ui/slide_editor.rs @@ -61,7 +61,7 @@ struct EditorProgram { impl SlideEditor { pub fn view( &self, - font: Font, + _font: Font, ) -> cosmic::Element<'_, SlideWidget> { container( widget::canvas(&self.program) @@ -81,11 +81,11 @@ impl<'a> Program fn draw( &self, - state: &Self::State, + _state: &Self::State, renderer: &Renderer, - theme: &cosmic::Theme, + _theme: &cosmic::Theme, bounds: cosmic::iced::Rectangle, - cursor: cosmic::iced_core::mouse::Cursor, + _cursor: cosmic::iced_core::mouse::Cursor, ) -> Vec> { // We prepare a new `Frame` let mut frame = canvas::Frame::new(renderer, bounds.size()); @@ -154,8 +154,8 @@ impl<'a> Program delta, } => debug!(?delta, "scroll wheel"), }, - canvas::Event::Touch(event) => debug!("test"), - canvas::Event::Keyboard(event) => debug!("test"), + canvas::Event::Touch(_event) => debug!("test"), + canvas::Event::Keyboard(_event) => debug!("test"), } (canvas::event::Status::Ignored, None) } diff --git a/src/ui/song_editor.rs b/src/ui/song_editor.rs index 67b1fd7..6a72f48 100644 --- a/src/ui/song_editor.rs +++ b/src/ui/song_editor.rs @@ -1,5 +1,5 @@ use std::{ - io::{self, Read}, + io::{self}, path::PathBuf, sync::Arc, }; @@ -36,7 +36,7 @@ use tracing::{debug, error}; use crate::{ Background, BackgroundKind, core::{ - service_items::{ServiceItem, ServiceTrait}, + service_items::ServiceTrait, slide::Slide, songs::{Song, VerseName}, }, @@ -44,10 +44,7 @@ use crate::{ presenter::slide_view, slide_editor::SlideEditor, text_svg, - widgets::{ - draggable, - verse_editor::{self, VerseEditor}, - }, + widgets::verse_editor::{self, VerseEditor}, }, }; @@ -677,7 +674,7 @@ impl SongEditor { Message::ChipHovered(None) }) .on_finish( - move |mime, data, action, x, y| { + move |mime, data, action, _x, _y| { debug!(mime, ?data, ?action); Message::ChipDropped((index, data, mime)) }, @@ -723,7 +720,7 @@ impl SongEditor { column![verse_label, verse_order].spacing(space_s); let lyric_title = text::heading("Lyrics"); - let lyric_input = column![ + let _lyric_input = column![ lyric_title, text_editor(&self.lyrics) .on_action(Message::ChangeLyrics) @@ -773,7 +770,6 @@ impl SongEditor { space_s, space_m, space_l, - space_xl, space_xxxl, .. } = theme::spacing(); diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs index 108dc23..19aaa3f 100644 --- a/src/ui/text_svg.rs +++ b/src/ui/text_svg.rs @@ -15,12 +15,11 @@ use cosmic::{ widget::{Image, image::Handle}, }; use rapidhash::v3::rapidhash_v3; -use rayon::str::ParallelString; use resvg::{ tiny_skia::{self, Pixmap}, usvg::{Tree, fontdb}, }; -use tracing::{debug, error, warn}; +use tracing::error; use crate::TextAlignment; diff --git a/src/ui/widgets/slide_text.rs b/src/ui/widgets/slide_text.rs index c97ffbc..efdaa54 100644 --- a/src/ui/widgets/slide_text.rs +++ b/src/ui/widgets/slide_text.rs @@ -101,22 +101,22 @@ impl TextPrimitive { impl Primitive for TextPrimitive { fn prepare( &self, - device: &cosmic::iced::wgpu::Device, - queue: &cosmic::iced::wgpu::Queue, - format: cosmic::iced::wgpu::TextureFormat, - storage: &mut cosmic::iced_widget::shader::Storage, - bounds: &Rectangle, - viewport: &cosmic::iced_wgpu::graphics::Viewport, + _device: &cosmic::iced::wgpu::Device, + _queue: &cosmic::iced::wgpu::Queue, + _format: cosmic::iced::wgpu::TextureFormat, + _storage: &mut cosmic::iced_widget::shader::Storage, + _bounds: &Rectangle, + _viewport: &cosmic::iced_wgpu::graphics::Viewport, ) { todo!() } fn render( &self, - encoder: &mut cosmic::iced::wgpu::CommandEncoder, - storage: &cosmic::iced_widget::shader::Storage, - target: &cosmic::iced::wgpu::TextureView, - clip_bounds: &Rectangle, + _encoder: &mut cosmic::iced::wgpu::CommandEncoder, + _storage: &cosmic::iced_widget::shader::Storage, + _target: &cosmic::iced::wgpu::TextureView, + _clip_bounds: &Rectangle, ) { todo!() } diff --git a/src/ui/widgets/verse_editor.rs b/src/ui/widgets/verse_editor.rs index 49482a1..f0af37a 100644 --- a/src/ui/widgets/verse_editor.rs +++ b/src/ui/widgets/verse_editor.rs @@ -1,9 +1,8 @@ use cosmic::{ - Apply, Element, Task, - iced::{Border, Length, alignment::Vertical}, - iced_widget::{column, row}, + Element, Task, + iced_widget::column, theme, - widget::{container, icon, text, text_editor}, + widget::{container, text, text_editor}, }; use crate::core::songs::VerseName;