refactor: use canonical module paths
This commit is contained in:
1 parent
c6205a337c
commit
feeb3e6d50
21 files changed
+28
-46
No files matched your search
+1
-3
@@ -7,9 +7,7 @@ pub mod logging;
|
||||
mod render;
|
||||
pub mod widgets;
|
||||
|
||||
pub use crate::feedback::errors as error_buffer;
|
||||
pub use crate::feedback::progress;
|
||||
pub use crate::feedback::request_redraw;
|
||||
use crate::feedback::request_redraw;
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests;
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::{
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use crate::instance::ContentEntry;
|
||||
use crate::instance::content::entry::ContentEntry;
|
||||
use ratatui::{
|
||||
buffer::Buffer,
|
||||
layout::Rect,
|
||||
|
||||
@@ -3,7 +3,8 @@ use std::sync::{Arc, Mutex};
|
||||
|
||||
use crossterm::event::{KeyCode, KeyEvent};
|
||||
|
||||
use crate::instance::{ContentEntry, ContentKind, InstanceConfig, ModLoader};
|
||||
use crate::instance::content::entry::ContentEntry;
|
||||
use crate::instance::{ContentKind, InstanceConfig, ModLoader};
|
||||
use crate::net::modrinth::{DiscoveryProject, VersionInfo};
|
||||
|
||||
use super::list::{ContentListState, ContentStream};
|
||||
|
||||
@@ -20,7 +20,8 @@ use ratatui_image::{CropOptions, Resize, StatefulImage, protocol::StatefulProtoc
|
||||
use tui_widget_list::{ListBuilder, ListState as TuiListState, ListView};
|
||||
|
||||
use crate::config::theme::THEME;
|
||||
use crate::instance::content::{ContentEntry, IconCell};
|
||||
use crate::instance::content::entry::ContentEntry;
|
||||
use crate::instance::content::icons::IconCell;
|
||||
|
||||
type ScanOneFn = fn(&Path, &str, bool) -> ContentEntry;
|
||||
static PROVIDER_ICON_SLOTS: LazyLock<Arc<tokio::sync::Semaphore>> =
|
||||
@@ -1161,7 +1162,7 @@ impl ContentListState {
|
||||
let Some(entry) = self.entries.get(index) else {
|
||||
return;
|
||||
};
|
||||
match crate::instance::content::toggle_entry_path(entry) {
|
||||
match crate::instance::content::entry::toggle_entry_path(entry) {
|
||||
Ok(Some(new_path)) => {
|
||||
let entry = &mut self.entries[index];
|
||||
entry.enabled = !entry.enabled;
|
||||
@@ -1954,10 +1955,7 @@ fn ellipsize(text: &str, max_width: usize) -> String {
|
||||
visible
|
||||
}
|
||||
|
||||
fn protocol_icon_columns(
|
||||
entry: &crate::instance::ContentEntry,
|
||||
picker: &ratatui_image::picker::Picker,
|
||||
) -> u16 {
|
||||
fn protocol_icon_columns(entry: &ContentEntry, picker: &ratatui_image::picker::Picker) -> u16 {
|
||||
let rows = entry.icon_lines.as_ref().map_or(3, Vec::len) as u16;
|
||||
let font_size = picker.font_size();
|
||||
square_icon_columns(rows, (font_size.width, font_size.height))
|
||||
@@ -2081,7 +2079,7 @@ fn diff_event_paths(
|
||||
fn watcher_diff(
|
||||
toggled: Vec<(String, bool, std::path::PathBuf)>,
|
||||
removed: Vec<String>,
|
||||
added: Vec<crate::instance::ContentEntry>,
|
||||
added: Vec<ContentEntry>,
|
||||
) -> Option<WatcherDiff> {
|
||||
if toggled.is_empty() && removed.is_empty() && added.is_empty() {
|
||||
None
|
||||
|
||||
@@ -17,7 +17,8 @@ use crate::tui::widgets::content::{ContentMode, DiscoveryState};
|
||||
|
||||
use crate::tui::widgets::styled_title;
|
||||
|
||||
type ContentScanner = fn(&std::path::Path, &str, bool) -> crate::instance::ContentEntry;
|
||||
type ContentScanner =
|
||||
fn(&std::path::Path, &str, bool) -> crate::instance::content::entry::ContentEntry;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct DownloadableTab {
|
||||
|
||||
Reference in new issue
Block a user