chore(deps): migrate to 2024 rust

This commit is contained in:
nnyyxxxx 2025-02-12 03:56:55 -05:00
parent c12ae4a8ef
commit e95c89bf26
No known key found for this signature in database
GPG Key ID: 6038FFD6589902CB
13 changed files with 26 additions and 29 deletions

View File

@ -1,7 +1,7 @@
[workspace.package]
license = "MIT"
version = "25.1.10"
edition = "2021"
edition = "2024"
[workspace]
members = ["tui", "core", "xtask"]

View File

@ -2,7 +2,7 @@
name = "linutil_core"
description = "The backend of Linutil."
repository = "https://github.com/ChrisTitusTech/linutil/tree/main/core"
edition = "2021"
edition = "2024"
version.workspace = true
license.workspace = true
include = ["src/*.rs", "Cargo.toml", "tabs/**"]

View File

@ -1,6 +1,6 @@
use crate::{Command, ListNode, Tab};
use ego_tree::{NodeMut, Tree};
use include_dir::{include_dir, Dir};
use include_dir::{Dir, include_dir};
use serde::Deserialize;
use std::{
fs::File,

View File

@ -8,7 +8,7 @@ use ego_tree::Tree;
use std::path::PathBuf;
pub use config::{Config, ConfigValues};
pub use inner::{get_tabs, TabList};
pub use inner::{TabList, get_tabs};
#[derive(Clone, Hash, Eq, PartialEq)]
pub enum Command {

View File

@ -3,7 +3,7 @@ name = "linutil_tui"
description = "Chris Titus Tech's Linux Toolbox - Linutil is a distro-agnostic toolbox designed to simplify everyday Linux tasks."
documentation = "https://christitustech.github.io/linutil"
readme = "../README.md"
edition = "2021"
edition = "2024"
license.workspace = true
repository = "https://github.com/ChrisTitusTech/linutil/tree/main/tui"
version.workspace = true

View File

@ -1,5 +1,5 @@
use crate::{state::ListEntry, theme::Theme};
use linutil_core::{ego_tree::NodeId, Tab};
use linutil_core::{Tab, ego_tree::NodeId};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
prelude::*,
@ -160,7 +160,7 @@ impl Filter {
pub fn handle_key(&mut self, event: &KeyEvent) -> SearchAction {
match event.code {
KeyCode::Char('c') if event.modifiers.contains(KeyModifiers::CONTROL) => {
return self.exit_search()
return self.exit_search();
}
KeyCode::Char(c) => self.insert_char(c),
KeyCode::Backspace => self.remove_previous(),

View File

@ -1,8 +1,8 @@
use crate::{hint::Shortcut, theme::Theme};
use ratatui::{
Frame,
crossterm::event::{KeyCode, KeyEvent, MouseEvent},
layout::{Constraint, Layout, Rect},
Frame,
};
pub trait FloatContent {

View File

@ -10,9 +10,7 @@ use tree_sitter_bash as hl_bash;
use tree_sitter_highlight::{self as hl, HighlightEvent};
macro_rules! style {
($r:literal, $g:literal, $b:literal) => {{
Style::new().fg(Color::Rgb($r, $g, $b))
}};
($r:literal, $g:literal, $b:literal) => {{ Style::new().fg(Color::Rgb($r, $g, $b)) }};
}
const SYNTAX_HIGHLIGHT_STYLES: [(&str, Style); 8] = [

View File

@ -15,18 +15,18 @@ mod tips;
use crate::cli::Args;
use clap::Parser;
use ratatui::{
Terminal,
backend::CrosstermBackend,
crossterm::{
ExecutableCommand,
event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyEventKind},
style::ResetColor,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
},
Terminal,
};
use state::AppState;
use std::{
io::{stdout, Result, Stdout},
io::{Result, Stdout, stdout},
time::Duration,
};

View File

@ -1,6 +1,6 @@
use crate::{float::FloatContent, hint::Shortcut, shortcuts, theme::Theme};
use linutil_core::Command;
use oneshot::{channel, Receiver};
use oneshot::{Receiver, channel};
use portable_pty::{
ChildKiller, CommandBuilder, ExitStatus, MasterPty, NativePtySystem, PtySize, PtySystem,
};
@ -16,7 +16,7 @@ use std::{
sync::{Arc, Mutex},
thread::JoinHandle,
};
use time::{macros::format_description, OffsetDateTime};
use time::{OffsetDateTime, macros::format_description};
use tui_term::widget::PseudoTerminal;
use vt100_ctt::{Parser, Screen};
@ -230,7 +230,7 @@ impl RunningCommand {
break; // EOF
}
let mut mutex = command_buffer.lock(); // Only lock the mutex after the read is
// done, to minimise the time it is opened
// done, to minimise the time it is opened
let command_buffer = mutex.as_mut().unwrap();
command_buffer.extend_from_slice(&buf[0..size]);
// The mutex is closed here automatically

View File

@ -1,16 +1,16 @@
use crate::{
Args,
confirmation::{ConfirmPrompt, ConfirmStatus},
filter::{Filter, SearchAction},
float::{Float, FloatContent},
floating_text::FloatingText,
hint::{create_shortcut_list, Shortcut},
hint::{Shortcut, create_shortcut_list},
root::check_root_status,
running_command::RunningCommand,
shortcuts,
theme::Theme,
Args,
};
use linutil_core::{ego_tree::NodeId, Command, Config, ConfigValues, ListNode, TabList};
use linutil_core::{Command, Config, ConfigValues, ListNode, TabList, ego_tree::NodeId};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseEvent, MouseEventKind},
layout::Flex,
@ -209,10 +209,9 @@ impl AppState {
hints.push(Shortcut::new("Focus tab list", ["h", "Left"]));
hints.extend(self.get_list_item_shortcut());
} else if self.selected_item_is_up_dir() {
hints.push(Shortcut::new(
"Go to parent directory",
["l", "Right", "Enter", "h", "Left"],
));
hints.push(Shortcut::new("Go to parent directory", [
"l", "Right", "Enter", "h", "Left",
]));
} else {
hints.push(Shortcut::new("Go to parent directory", ["h", "Left"]));
hints.extend(self.get_list_item_shortcut());

View File

@ -2,7 +2,7 @@ use std::fs;
use linutil_core::Command;
use crate::{path, DynError};
use crate::{DynError, path};
pub const USER_GUIDE: &str = "userguide.md";
@ -43,8 +43,8 @@ pub fn userguide() -> Result<String, DynError> {
md.push_str(&format!("- **{}**: {}\n", entry.name, entry.description));
} /* else {
md.push_str(&format!("- **{}**\n", entry.name));
} */ // https://github.com/ChrisTitusTech/linutil/pull/753
md.push_str(&format!("- **{}**\n", entry.name));
} */ // https://github.com/ChrisTitusTech/linutil/pull/753
}
}

View File

@ -7,8 +7,8 @@ type DynError = Box<dyn Error>;
pub mod tasks {
use crate::{
docgen::{userguide, write, USER_GUIDE},
DynError,
docgen::{USER_GUIDE, userguide, write},
};
pub fn docgen() -> Result<(), DynError> {