fixing lint issues and style issues
This commit is contained in:
parent
f3d0ec9aa2
commit
8c59688e2f
7 changed files with 30 additions and 23 deletions
|
|
@ -114,10 +114,10 @@ pub async fn get_genius_lyrics(
|
|||
root.inner_html()
|
||||
})
|
||||
.collect::<String>();
|
||||
let lyrics = lyrics.find("[").map_or_else(
|
||||
let lyrics = lyrics.find('[').map_or_else(
|
||||
|| {
|
||||
lyrics.find("</div></div></div>").map_or(
|
||||
lyrics.clone(),
|
||||
lyrics.find("</div></div></div>").map_or_else(
|
||||
|| lyrics.clone(),
|
||||
|position| {
|
||||
lyrics.split_at(position + 18).1.to_string()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use cosmic::cosmic_config::{Config, CosmicConfigEntry};
|
|||
use cosmic::dialog::file_chooser::{open, save};
|
||||
use cosmic::iced::alignment::Vertical;
|
||||
use cosmic::iced::keyboard::{Key, Modifiers};
|
||||
use cosmic::iced::window::{Mode, Position};
|
||||
use cosmic::iced::window::Position;
|
||||
use cosmic::iced::{
|
||||
self, Background as IcedBackground, Border, Color, Length, event,
|
||||
window,
|
||||
|
|
@ -700,7 +700,7 @@ impl cosmic::Application for App {
|
|||
// debug!(?platform_specific);
|
||||
None
|
||||
}
|
||||
iced::Event::InputMethod(event) => todo!(),
|
||||
iced::Event::InputMethod(_event) => todo!(),
|
||||
}
|
||||
}
|
||||
event::Status::Captured => None,
|
||||
|
|
@ -1858,6 +1858,7 @@ where
|
|||
},
|
||||
)
|
||||
})
|
||||
|
||||
// if let Some(library) = self.library.clone() {
|
||||
// Task::perform(
|
||||
// async move { library.search_items(query).await },
|
||||
|
|
|
|||
|
|
@ -177,10 +177,19 @@ impl<'a> Library {
|
|||
})
|
||||
.and_then(move |db| {
|
||||
Task::perform(
|
||||
add_song_to_db(db),
|
||||
self.song_library.new_song(db),
|
||||
move |res| {
|
||||
res.map(|song| {
|
||||
Message::AddSong(song)
|
||||
let index = (self
|
||||
.song_library
|
||||
.items
|
||||
.len()
|
||||
- 1)
|
||||
as i32;
|
||||
Message::OpenItem(Some((
|
||||
LibraryKind::Song,
|
||||
index,
|
||||
)))
|
||||
})
|
||||
},
|
||||
)
|
||||
|
|
@ -214,7 +223,7 @@ impl<'a> Library {
|
|||
// Check if empty
|
||||
let mut tasks = Vec::new();
|
||||
if let Some(videos) = videos {
|
||||
let len = videos.len();
|
||||
// let len = videos.len();
|
||||
for video in videos {
|
||||
if let Err(e) =
|
||||
self.video_library.add_item(video.clone())
|
||||
|
|
@ -290,7 +299,7 @@ impl<'a> Library {
|
|||
// Check if empty
|
||||
let mut tasks = Vec::new();
|
||||
if let Some(presentations) = presentations {
|
||||
let len = presentations.len();
|
||||
// let len = presentations.len();
|
||||
for presentation in presentations {
|
||||
if let Err(e) = self
|
||||
.presentation_library
|
||||
|
|
@ -331,7 +340,7 @@ impl<'a> Library {
|
|||
// Check if empty
|
||||
let mut tasks = Vec::new();
|
||||
if let Some(images) = images {
|
||||
let len = images.len();
|
||||
// let len = images.len();
|
||||
for image in images {
|
||||
if let Err(e) =
|
||||
self.image_library.add_item(image.clone())
|
||||
|
|
@ -692,7 +701,7 @@ impl<'a> Library {
|
|||
add_song_to_db(db),
|
||||
{
|
||||
move |res| {
|
||||
res.map(|song| {
|
||||
res.map(|_song| {
|
||||
Message::None
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,11 +157,11 @@ impl<'a> Program<SlideWidget, cosmic::Theme, cosmic::Renderer>
|
|||
},
|
||||
canvas::Event::Touch(_event) => debug!("test"),
|
||||
canvas::Event::Keyboard(_event) => debug!("test"),
|
||||
canvas::Event::Window(event) => todo!(),
|
||||
canvas::Event::InputMethod(event) => todo!(),
|
||||
canvas::Event::A11y(id, action_request) => todo!(),
|
||||
canvas::Event::Dnd(dnd_event) => todo!(),
|
||||
canvas::Event::PlatformSpecific(platform_specific) => {
|
||||
canvas::Event::Window(_event) => todo!(),
|
||||
canvas::Event::InputMethod(_event) => todo!(),
|
||||
canvas::Event::A11y(_id, _action_request) => todo!(),
|
||||
canvas::Event::Dnd(_dnd_event) => todo!(),
|
||||
canvas::Event::PlatformSpecific(_platform_specific) => {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use cosmic::iced::advanced::layout::{self, Layout};
|
|||
use cosmic::iced::advanced::widget::{Operation, Tree, Widget, tree};
|
||||
use cosmic::iced::advanced::{Clipboard, Shell, overlay, renderer};
|
||||
use cosmic::iced::alignment::{self, Alignment};
|
||||
use cosmic::iced::event::{self, Event};
|
||||
use cosmic::iced::event::Event;
|
||||
use cosmic::iced::{self, Transformation, mouse};
|
||||
use cosmic::iced::{
|
||||
Background, Border, Color, Element, Length, Padding, Pixels,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use cosmic::iced::advanced::layout::{self, Layout};
|
|||
use cosmic::iced::advanced::widget::{Operation, Tree, Widget, tree};
|
||||
use cosmic::iced::advanced::{Clipboard, Shell, overlay, renderer};
|
||||
use cosmic::iced::alignment::{self, Alignment};
|
||||
use cosmic::iced::event::{self, Event};
|
||||
use cosmic::iced::event::Event;
|
||||
use cosmic::iced::{self, Transformation, mouse};
|
||||
use cosmic::iced::{
|
||||
Background, Border, Color, Element, Length, Padding, Pixels,
|
||||
|
|
@ -535,8 +535,7 @@ where
|
|||
_ => {}
|
||||
}
|
||||
|
||||
let child_status = self
|
||||
.children
|
||||
self.children
|
||||
.iter_mut()
|
||||
.zip(&mut tree.children)
|
||||
.zip(layout.children())
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ use cosmic::{
|
|||
iced_widget::{column, row},
|
||||
theme,
|
||||
widget::{
|
||||
button, combo_box, container, icon,
|
||||
space::{self, horizontal},
|
||||
text_editor,
|
||||
button, combo_box, container, icon, space, text_editor,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue