Commit 5ad5070bed
5ad5070bedf4c7fd74250bcbf52b644c605d8f78
parent: 9c63221f6b
Unsigned
Siriusmart <sirius@siri.ws> · 2025-11-08 11:32 UTC
made clippy happy
Layout: unified · split
src/exit.rs
+1 −1
| @@ -16,7 +16,7 @@ use crate::{ |
| 16 | // - move thumbnails of videos in watch history to `~/.local/share/youtube-tui/watch_history/thumbnails` |
16 | // - move thumbnails of videos in watch history to `~/.local/share/youtube-tui/watch_history/thumbnails` |
| 17 | // - remove `~/.cache` |
17 | // - remove `~/.cache` |
| 18 | pub fn exit(framework: &mut Framework) -> Result<(), Box<dyn Error>> { |
18 | pub fn exit(framework: &mut Framework) -> Result<(), Box<dyn Error>> { |
| 19 | let mut limits = framework.data.global.remove::<MainConfig>().unwrap().limits; |
19 | let limits = framework.data.global.remove::<MainConfig>().unwrap().limits; |
| 20 | let mut watchhistory = framework.data.global.remove::<WatchHistory>().unwrap(); |
20 | let mut watchhistory = framework.data.global.remove::<WatchHistory>().unwrap(); |
| 21 | watchhistory.trim(limits.watch_history); |
21 | watchhistory.trim(limits.watch_history); |
| 22 | // watchhistory.exit_move(); |
22 | // watchhistory.exit_move(); |
src/global/functions/run_command.rs
+1 −3
| @@ -4,12 +4,10 @@ use crate::{ |
| 4 | load_configs, |
4 | load_configs, |
| 5 | }; |
5 | }; |
| 6 | use crossterm::event::{KeyEvent, KeyModifiers}; |
6 | use crossterm::event::{KeyEvent, KeyModifiers}; |
| 7 | use home::home_dir; |
| |
| 8 | use ratatui::{backend::CrosstermBackend, Terminal}; |
7 | use ratatui::{backend::CrosstermBackend, Terminal}; |
| 9 | use std::{ |
8 | use std::{ |
| 10 | env, |
9 | env, |
| 11 | error::Error, |
10 | error::Error, |
| 12 | fs, |
| |
| 13 | io::Stdout, |
11 | io::Stdout, |
| 14 | process::{Command, Stdio}, |
12 | process::{Command, Stdio}, |
| 15 | sync::Arc, |
13 | sync::Arc, |
| @@ -122,7 +120,7 @@ pub fn run_single_command( |
| 122 | // match a command splitted by space to a bunch of avaliable commands |
120 | // match a command splitted by space to a bunch of avaliable commands |
| 123 | match command { |
121 | match command { |
| 124 | [] => {} |
122 | [] => {} |
| 125 | ["bookmark", id] => match (|| LocalStore::get_info(&id))() { |
123 | ["bookmark", id] => match LocalStore::get_info(id) { |
| 126 | Some(item) => { |
124 | Some(item) => { |
| 127 | let library = framework.data.global.get_mut::<Library>().unwrap(); |
125 | let library = framework.data.global.get_mut::<Library>().unwrap(); |
| 128 | let _ = library.push(item); |
126 | let _ = library.push(item); |
src/global/structs/localstore.rs
+1 −1
| @@ -12,7 +12,7 @@ static mut LOCALSTORE: OnceLock<LocalStore> = OnceLock::new(); |
| 12 | |
12 | |
| 13 | pub struct LocalRecord { |
13 | pub struct LocalRecord { |
| 14 | item: Item, |
14 | item: Item, |
| 15 | is_new: bool |
15 | is_new: bool, |
| 16 | } |
16 | } |
| 17 | |
17 | |
| 18 | /// cached access and write files to ~/.local/share |
18 | /// cached access and write files to ~/.local/share |
src/items/itemlist.rs
−1
| @@ -5,7 +5,6 @@ use crate::{ |
| 5 | global::{functions::*, structs::*, traits::SearchProviderWrapper}, |
5 | global::{functions::*, structs::*, traits::SearchProviderWrapper}, |
| 6 | items::ItemInfo, |
6 | items::ItemInfo, |
| 7 | }; |
7 | }; |
| 8 | use home::home_dir; |
| |
| 9 | use ratatui::{ |
8 | use ratatui::{ |
| 10 | layout::{Constraint, Rect}, |
9 | layout::{Constraint, Rect}, |
| 11 | style::Style, |
10 | style::Style, |