alot of fixing unused imports and variables

This commit is contained in:
Chris Cochrun 2026-01-27 15:00:46 -06:00
parent 65c55de54e
commit cab00b0ae7
16 changed files with 57 additions and 67 deletions

View file

@ -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!()
}

View file

@ -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()))])
}
}

View file

@ -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!()
}
}

View file

@ -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<PathBuf> for LibraryKind {
fn from(value: PathBuf) -> Self {
fn from(_value: PathBuf) -> Self {
todo!()
}
}
@ -83,7 +79,7 @@ impl<T> Model<T> {
Ok(())
}
pub fn add_to_db(&mut self, item: T) -> Result<()> {
pub fn add_to_db(&mut self, _item: T) -> Result<()> {
todo!()
}

View file

@ -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()

View file

@ -180,7 +180,7 @@ impl TryFrom<PathBuf> for Background {
_ => Err(ParseError::NonBackgroundFile),
}
}
Err(e) => {
Err(_e) => {
// error!("Couldn't canonicalize: {e} {:?}", path);
Err(ParseError::CannotCanonicalize)
}
@ -260,7 +260,7 @@ impl From<String> 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<String> {
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::<Vec<Slide>>(&slide) {
Ok(s) => {
Ok(_s) => {
assert!(true)
}
Err(e) => {
Err(_e) => {
assert!(false)
}
}

View file

@ -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,
};

View file

@ -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" => {

View file

@ -1,7 +1,7 @@
use std::{
collections::HashMap,
io,
ops::{Range, RangeBounds},
ops::RangeBounds,
path::{Path, PathBuf},
};

View file

@ -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))
}))

View file

@ -165,10 +165,10 @@ impl<Message: Clone + 'static>
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::<State>();
@ -205,7 +205,7 @@ impl<Message: Clone + 'static>
{
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<Message: Clone + 'static>
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::<State>();
for item in self.service {}
for _item in self.service {}
}
// fn overlay<'b>(

View file

@ -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<SlideWidget, cosmic::Theme, cosmic::Renderer>
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<canvas::Geometry<Renderer>> {
// We prepare a new `Frame`
let mut frame = canvas::Frame::new(renderer, bounds.size());
@ -154,8 +154,8 @@ impl<'a> Program<SlideWidget, cosmic::Theme, cosmic::Renderer>
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)
}

View file

@ -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();

View file

@ -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;

View file

@ -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<u32>,
_encoder: &mut cosmic::iced::wgpu::CommandEncoder,
_storage: &cosmic::iced_widget::shader::Storage,
_target: &cosmic::iced::wgpu::TextureView,
_clip_bounds: &Rectangle<u32>,
) {
todo!()
}

View file

@ -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;