diff --git a/Cargo.lock b/Cargo.lock index f19bdd840..82d76fabf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,9 +64,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "captur" -version = "0.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70fab32548d14602e13307a86c41b2dc2fc2ef19c2881bf63598275a7e45b182" +checksum = "c9a14cdf43feefc0ce44a775cd4e0c0fc68da9b82b2a3162f3d565aa38fed6ed" [[package]] name = "cc" @@ -100,12 +100,9 @@ dependencies = [ [[package]] name = "claims" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6995bbe186456c36307f8ea36be3eefe42f49d106896414e18efc4fb2f846b5" -dependencies = [ - "autocfg", -] +checksum = "bba18ee93d577a8428902687bcc2b6b45a56b1981a1f6d779731c86cc4c5db18" [[package]] name = "cmake" @@ -139,16 +136,16 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ "bitflags 2.5.0", "crossterm_winapi", "filedescriptor", - "libc", "mio", "parking_lot", + "rustix", "signal-hook", "signal-hook-mio", "winapi", @@ -188,7 +185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -357,9 +354,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.18.3" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" +checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ "bitflags 2.5.0", "libc", @@ -380,6 +377,12 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "iana-time-zone" version = "0.1.60" @@ -470,15 +473,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libgit2-sys" -version = "0.16.2+1.7.2" +version = "0.17.0+1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" dependencies = [ "cc", "libc", @@ -516,9 +519,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -544,14 +547,15 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "log", "wasi", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -802,15 +806,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -877,9 +881,9 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", "mio", @@ -930,7 +934,7 @@ dependencies = [ "cfg-if", "fastrand", "rustix", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1014,9 +1018,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "url" @@ -1031,9 +1035,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand", @@ -1047,9 +1051,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version-track" -version = "0.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9affed6b4e63b1f30ed8f0f2c401fa725f5f511eb00e52269f401c4d5ae12f" +checksum = "60ec7a62135e5134172e48cdc4a0e5499d357d65c1ee4f3442d51e05e3f71d7c" dependencies = [ "uuid", ] @@ -1145,15 +1149,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index cf5c69e3b..af7844284 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ include = [ "/test" ] edition = "2021" +rust-version = "1.77.0" [[bin]] name = "interactive-rebase-tool" @@ -28,11 +29,11 @@ path = "src/main.rs" [dependencies] anyhow = "1.0.86" bitflags = "2.5.0" -captur = "0.1.0" +captur = "1.0.0" chrono = "0.4.38" crossbeam-channel = "0.5.13" -crossterm = "0.27.0" -git2 = { version = "0.18.3", default-features = false, features = [] } +crossterm = "0.28.0" +git2 = { version = "0.19.0", default-features = false, features = [] } if_chain = "1.0.2" lazy_static = "1.4.0" num-format = "0.4.4" @@ -40,16 +41,16 @@ parking_lot = "0.12.3" pico-args = "0.5.0" thiserror = "1.0.61" unicode-segmentation = "1.10.1" -unicode-width = "0.1.12" +unicode-width = "0.2.0" uuid = { version = "1.8.0", features = ["v4", "fast-rng"] } -version-track = "0.1.0" +version-track = "1.0.0" xi-unicode = "0.3.0" [target.'cfg(target_os = "macos")'.dependencies] -crossterm = { version = "0.27.0", features = ["use-dev-tty"] } +crossterm = { version = "0.28.0", features = ["use-dev-tty"] } [dev-dependencies] -claims = "0.7.1" +claims = "0.8.0" itertools = "0.13.0" pretty_assertions = "1.4.0" regex = "1.8.4" @@ -117,6 +118,7 @@ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] } # absolute_paths_not_starting_with_crate - group rust_2018_compatibility # box-pointers - used in project, and is safe to do so deprecated_in_future = "warn" +edition_2024_expr_fragment_specifier = "allow" # elided_lifetimes_in_paths - group: rust_2018_idioms # explicit_outlives_requirements - group: rust_2018_idioms ffi_unwind_calls = "warn" @@ -173,6 +175,7 @@ absolute_paths = "allow" as_conversions = "allow" arithmetic_side_effects = "allow" bool_to_int_with_if = "allow" +cfg_not_test = "allow" default_numeric_fallback = "allow" else_if_without_else = "allow" expect_used = "allow" diff --git a/build.rs b/build.rs index 9f5dd27b0..1a06ea43f 100644 --- a/build.rs +++ b/build.rs @@ -1,7 +1,7 @@ use std::{env, process}; use chrono::{TimeZone, Utc}; -use rustc_version::{version_meta, Channel}; +use rustc_version::{Channel, version_meta}; fn main() { println!("cargo::rustc-check-cfg=cfg(allow_unknown_lints)"); diff --git a/src/application.rs b/src/application.rs index 82aeab826..77c6be1a4 100644 --- a/src/application.rs +++ b/src/application.rs @@ -4,6 +4,8 @@ use anyhow::Result; use parking_lot::Mutex; use crate::{ + Args, + Exit, config::Config, display::Display, git::Repository, @@ -15,8 +17,6 @@ use crate::{ search, todo_file::{TodoFile, TodoFileOptions}, view::View, - Args, - Exit, }; pub(crate) struct Application @@ -198,12 +198,12 @@ mod tests { module::Modules, runtime::{Installer, RuntimeError}, test_helpers::{ + DefaultTestModule, + TestModuleProvider, create_config, create_event_reader, mocks, with_git_directory, - DefaultTestModule, - TestModuleProvider, }, }; diff --git a/src/config.rs b/src/config.rs index fd32bbd25..7d6202592 100644 --- a/src/config.rs +++ b/src/config.rs @@ -41,29 +41,29 @@ const DEFAULT_TAB_SYMBOL: &str = "\u{2192}"; // → #[non_exhaustive] pub(crate) struct Config { /// If to select the next line in the list after performing an action. - pub(crate) auto_select_next: bool, + pub auto_select_next: bool, /// How to handle whitespace when calculating diffs. - pub(crate) diff_ignore_whitespace: DiffIgnoreWhitespaceSetting, + pub diff_ignore_whitespace: DiffIgnoreWhitespaceSetting, /// If to ignore blank lines when calculating diffs. - pub(crate) diff_ignore_blank_lines: bool, + pub diff_ignore_blank_lines: bool, /// How to show whitespace in diffs. - pub(crate) diff_show_whitespace: DiffShowWhitespaceSetting, + pub diff_show_whitespace: DiffShowWhitespaceSetting, /// The symbol used to replace space characters. - pub(crate) diff_space_symbol: String, + pub diff_space_symbol: String, /// The symbol used to replace tab characters. - pub(crate) diff_tab_symbol: String, + pub diff_tab_symbol: String, /// The display width of the tab character. - pub(crate) diff_tab_width: u32, + pub diff_tab_width: u32, /// If set, automatically add an exec line with the command after every modified line - pub(crate) post_modified_line_exec_command: Option, + pub post_modified_line_exec_command: Option, /// The maximum number of undo steps. - pub(crate) undo_limit: u32, + pub undo_limit: u32, /// Configuration options loaded directly from Git. - pub(crate) git: GitConfig, + pub git: GitConfig, /// Key binding configuration. - pub(crate) key_bindings: KeyBindings, + pub key_bindings: KeyBindings, /// Theme configuration. - pub(crate) theme: Theme, + pub theme: Theme, } impl Config { diff --git a/src/config/git_config.rs b/src/config/git_config.rs index 6ce8c4bf4..e40a2c9fe 100644 --- a/src/config/git_config.rs +++ b/src/config/git_config.rs @@ -2,8 +2,8 @@ use std::env; use crate::{ config::{ - utils::{get_string, get_unsigned_integer, git_diff_renames}, ConfigError, + utils::{get_string, get_unsigned_integer, git_diff_renames}, }, git::Config, }; @@ -28,31 +28,31 @@ pub(crate) struct GitConfig { /// The Git comment character, from [`core.commentChar`]( /// https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar /// ). - pub(crate) comment_char: String, + pub comment_char: String, /// Number of context lines, from [`diff.context`]( /// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffcontext /// ). - pub(crate) diff_context: u32, + pub diff_context: u32, /// Number of interhunk lines, from [`diff.interhunk_lines`]( /// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffinterHunkContext /// ). - pub(crate) diff_interhunk_lines: u32, + pub diff_interhunk_lines: u32, /// The limit for detecting renames, from [`diff.renameLimit`]( /// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffrenameLimit /// ). - pub(crate) diff_rename_limit: u32, + pub diff_rename_limit: u32, /// If to detect renames, from [`diff.renames`]( /// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffrenames /// ). - pub(crate) diff_renames: bool, + pub diff_renames: bool, /// If to detect copies, from [`diff.renames`]( /// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffrenames /// ). - pub(crate) diff_copies: bool, + pub diff_copies: bool, /// The Git editor, from [`core.editor`]( /// https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreeditor /// ). - pub(crate) editor: String, + pub editor: String, } impl GitConfig { @@ -92,7 +92,7 @@ mod tests { use super::*; use crate::{ config::ConfigErrorCause, - test_helpers::{invalid_utf, with_env_var, with_git_config, EnvVarAction}, + test_helpers::{EnvVarAction, invalid_utf, with_env_var, with_git_config}, }; macro_rules! config_test { diff --git a/src/config/key_bindings.rs b/src/config/key_bindings.rs index b81b235cd..c084d4391 100644 --- a/src/config/key_bindings.rs +++ b/src/config/key_bindings.rs @@ -1,5 +1,5 @@ use crate::{ - config::{utils::get_input, ConfigError}, + config::{ConfigError, utils::get_input}, git::Config, }; @@ -17,100 +17,100 @@ fn map_single_ascii_to_lower(s: &str) -> String { #[non_exhaustive] pub(crate) struct KeyBindings { /// Key bindings for aborting. - pub(crate) abort: Vec, + pub abort: Vec, /// Key bindings for the break action. - pub(crate) action_break: Vec, + pub action_break: Vec, /// Key bindings for the drop action. - pub(crate) action_drop: Vec, + pub action_drop: Vec, /// Key bindings for the edit action. - pub(crate) action_edit: Vec, + pub action_edit: Vec, /// Key bindings for the fixup action. - pub(crate) action_fixup: Vec, + pub action_fixup: Vec, /// Key bindings for the pick action. - pub(crate) action_pick: Vec, + pub action_pick: Vec, /// Key bindings for the reword action. - pub(crate) action_reword: Vec, + pub action_reword: Vec, /// Key bindings for the squash action. - pub(crate) action_squash: Vec, + pub action_squash: Vec, /// Key bindings for negative confirmation. - pub(crate) confirm_no: Vec, + pub confirm_no: Vec, /// Key bindings for positive confirmation. - pub(crate) confirm_yes: Vec, + pub confirm_yes: Vec, /// Key bindings for editing. - pub(crate) edit: Vec, + pub edit: Vec, /// Key bindings for forcing a abort. - pub(crate) force_abort: Vec, + pub force_abort: Vec, /// Key bindings for forcing a rebase. - pub(crate) force_rebase: Vec, + pub force_rebase: Vec, /// Key bindings for showing help. - pub(crate) help: Vec, + pub help: Vec, /// Key bindings for inserting a line. - pub(crate) insert_line: Vec, + pub insert_line: Vec, /// Key bindings for moving down. - pub(crate) move_down: Vec, + pub move_down: Vec, /// Key bindings for moving to the end. - pub(crate) move_end: Vec, + pub move_end: Vec, /// Key bindings for moving to the start. - pub(crate) move_home: Vec, + pub move_home: Vec, /// Key bindings for moving to the left. - pub(crate) move_left: Vec, + pub move_left: Vec, /// Key bindings for moving to the right. - pub(crate) move_right: Vec, + pub move_right: Vec, /// Key bindings for moving up. - pub(crate) move_up: Vec, + pub move_up: Vec, /// Key bindings for moving down a step. - pub(crate) move_down_step: Vec, + pub move_down_step: Vec, /// Key bindings for moving up a step. - pub(crate) move_up_step: Vec, + pub move_up_step: Vec, /// Key bindings for moving the selection down. - pub(crate) move_selection_down: Vec, + pub move_selection_down: Vec, /// Key bindings for moving the selection up. - pub(crate) move_selection_up: Vec, + pub move_selection_up: Vec, /// Key bindings for scrolling down. - pub(crate) scroll_down: Vec, + pub scroll_down: Vec, /// Key bindings for scrolling to the end. - pub(crate) scroll_end: Vec, + pub scroll_end: Vec, /// Key bindings for scrolling to the start. - pub(crate) scroll_home: Vec, + pub scroll_home: Vec, /// Key bindings for scrolling to the left. - pub(crate) scroll_left: Vec, + pub scroll_left: Vec, /// Key bindings for scrolling to the right. - pub(crate) scroll_right: Vec, + pub scroll_right: Vec, /// Key bindings for scrolling up. - pub(crate) scroll_up: Vec, + pub scroll_up: Vec, /// Key bindings for scrolling down a step. - pub(crate) scroll_step_down: Vec, + pub scroll_step_down: Vec, /// Key bindings for scrolling up a step. - pub(crate) scroll_step_up: Vec, + pub scroll_step_up: Vec, /// Key bindings for opening the external editor. - pub(crate) open_in_external_editor: Vec, + pub open_in_external_editor: Vec, /// Key bindings for rebasing. - pub(crate) rebase: Vec, + pub rebase: Vec, /// Key bindings for redoing a change. - pub(crate) redo: Vec, + pub redo: Vec, /// Key bindings for removing a line. - pub(crate) remove_line: Vec, + pub remove_line: Vec, /// Key bindings for starting search. - pub(crate) search_start: Vec, + pub search_start: Vec, /// Key bindings for next search match. - pub(crate) search_next: Vec, + pub search_next: Vec, /// Key bindings for previous search match. - pub(crate) search_previous: Vec, + pub search_previous: Vec, /// Key bindings for showing a commit. - pub(crate) show_commit: Vec, + pub show_commit: Vec, /// Key bindings for showing a diff. - pub(crate) show_diff: Vec, + pub show_diff: Vec, /// Key bindings for toggling visual mode. - pub(crate) toggle_visual_mode: Vec, + pub toggle_visual_mode: Vec, /// Key bindings for undoing a change. - pub(crate) undo: Vec, + pub undo: Vec, /// Key bindings for the fixup specific action to toggle the c option. - pub(crate) fixup_keep_message_with_editor: Vec, + pub fixup_keep_message_with_editor: Vec, /// Key bindings for the fixup specific action to toggle the c option. - pub(crate) fixup_keep_message: Vec, + pub fixup_keep_message: Vec, } impl KeyBindings { diff --git a/src/config/theme.rs b/src/config/theme.rs index 3310aa443..325062ef6 100644 --- a/src/config/theme.rs +++ b/src/config/theme.rs @@ -1,9 +1,9 @@ use crate::{ config::{ - utils::{get_optional_string, get_string}, Color, ConfigError, ConfigErrorCause, + utils::{get_optional_string, get_string}, }, git::Config, }; @@ -28,49 +28,49 @@ fn get_color(config: Option<&Config>, name: &str, default: Color) -> Result, - pub(crate) author: User, - pub(crate) authored_date: Option>, - pub(crate) message: Option, - pub(crate) committer: Option, - pub(crate) committed_date: DateTime, - pub(crate) summary: Option, + pub hash: String, + pub reference: Option, + pub author: User, + pub authored_date: Option>, + pub message: Option, + pub committer: Option, + pub committed_date: DateTime, + pub summary: Option, } impl Commit { @@ -121,11 +121,11 @@ mod tests { use super::*; use crate::test_helpers::{ + CreateCommitOptions, + JAN_2021_EPOCH, builders::{CommitBuilder, ReferenceBuilder}, create_commit, with_temp_repository, - CreateCommitOptions, - JAN_2021_EPOCH, }; #[test] diff --git a/src/git/commit_diff_loader.rs b/src/git/commit_diff_loader.rs index d0b8a2515..6c10100b0 100644 --- a/src/git/commit_diff_loader.rs +++ b/src/git/commit_diff_loader.rs @@ -159,7 +159,7 @@ impl<'options> CommitDiffLoader<'options> { #[cfg(all(unix, test))] mod tests { use std::{ - fs::{remove_file, File}, + fs::{File, remove_file}, io::Write, os::unix::fs::symlink, }; diff --git a/src/git/commit_diff_loader_options.rs b/src/git/commit_diff_loader_options.rs index acb1f853c..ec0163d48 100644 --- a/src/git/commit_diff_loader_options.rs +++ b/src/git/commit_diff_loader_options.rs @@ -2,14 +2,14 @@ #[derive(Copy, Clone, Debug)] #[allow(clippy::struct_excessive_bools)] pub(crate) struct CommitDiffLoaderOptions { - pub(crate) context_lines: u32, - pub(crate) copies: bool, - pub(crate) ignore_whitespace: bool, - pub(crate) ignore_whitespace_change: bool, - pub(crate) ignore_blank_lines: bool, - pub(crate) interhunk_context: u32, - pub(crate) rename_limit: u32, - pub(crate) renames: bool, + pub context_lines: u32, + pub copies: bool, + pub ignore_whitespace: bool, + pub ignore_whitespace_change: bool, + pub ignore_blank_lines: bool, + pub interhunk_context: u32, + pub rename_limit: u32, + pub renames: bool, } impl CommitDiffLoaderOptions { diff --git a/src/git/reference_kind.rs b/src/git/reference_kind.rs index db2953641..14360f117 100644 --- a/src/git/reference_kind.rs +++ b/src/git/reference_kind.rs @@ -37,7 +37,7 @@ impl ReferenceKind { #[cfg(test)] mod tests { use super::*; - use crate::test_helpers::{with_temp_repository, JAN_2021_EPOCH}; + use crate::test_helpers::{JAN_2021_EPOCH, with_temp_repository}; #[test] fn from_git2_reference_branch() { diff --git a/src/input.rs b/src/input.rs index 38663c7e9..c298af695 100644 --- a/src/input.rs +++ b/src/input.rs @@ -23,11 +23,11 @@ pub(crate) use crossterm::event::{KeyCode, KeyEventKind, KeyModifiers, MouseEven pub(crate) use self::{ event::Event, event_handler::EventHandler, - event_provider::{read_event, EventReaderFn}, + event_provider::{EventReaderFn, read_event}, input_options::InputOptions, key_bindings::KeyBindings, key_event::KeyEvent, map_keybindings::map_keybindings, standard_event::StandardEvent, - thread::{State, Thread, THREAD_NAME}, + thread::{State, THREAD_NAME, Thread}, }; diff --git a/src/input/event_provider.rs b/src/input/event_provider.rs index e6743a7e2..c005aaaa3 100644 --- a/src/input/event_provider.rs +++ b/src/input/event_provider.rs @@ -1,9 +1,9 @@ use std::time::Duration; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; +use crossterm::event::{Event, KeyEvent}; #[cfg(not(test))] use crossterm::event::{poll, read}; -use crossterm::event::{Event, KeyEvent}; #[cfg(test)] use read_event_mocks::{poll, read}; diff --git a/src/input/key_bindings.rs b/src/input/key_bindings.rs index 550c82d5d..5c17f4f7d 100644 --- a/src/input/key_bindings.rs +++ b/src/input/key_bindings.rs @@ -1,103 +1,103 @@ -use crate::input::{map_keybindings, Event}; +use crate::input::{Event, map_keybindings}; /// Represents a mapping between an input event and an action. #[derive(Debug)] #[non_exhaustive] pub(crate) struct KeyBindings { /// Key bindings for redoing a change. - pub(crate) redo: Vec, + pub redo: Vec, /// Key bindings for undoing a change. - pub(crate) undo: Vec, + pub undo: Vec, /// Key bindings for scrolling down. - pub(crate) scroll_down: Vec, + pub scroll_down: Vec, /// Key bindings for scrolling to the end. - pub(crate) scroll_end: Vec, + pub scroll_end: Vec, /// Key bindings for scrolling to the start. - pub(crate) scroll_home: Vec, + pub scroll_home: Vec, /// Key bindings for scrolling to the left. - pub(crate) scroll_left: Vec, + pub scroll_left: Vec, /// Key bindings for scrolling to the right. - pub(crate) scroll_right: Vec, + pub scroll_right: Vec, /// Key bindings for scrolling up. - pub(crate) scroll_up: Vec, + pub scroll_up: Vec, /// Key bindings for scrolling down a step. - pub(crate) scroll_step_down: Vec, + pub scroll_step_down: Vec, /// Key bindings for scrolling up a step. - pub(crate) scroll_step_up: Vec, + pub scroll_step_up: Vec, /// Key bindings for help. - pub(crate) help: Vec, + pub help: Vec, /// Key bindings for starting search. - pub(crate) search_start: Vec, + pub search_start: Vec, /// Key bindings for next search match. - pub(crate) search_next: Vec, + pub search_next: Vec, /// Key bindings for previous search match. - pub(crate) search_previous: Vec, + pub search_previous: Vec, /// Key bindings for aborting. - pub(crate) abort: Vec, + pub abort: Vec, /// Key bindings for the break action. - pub(crate) action_break: Vec, + pub action_break: Vec, /// Key bindings for the drop action. - pub(crate) action_drop: Vec, + pub action_drop: Vec, /// Key bindings for the edit action. - pub(crate) action_edit: Vec, + pub action_edit: Vec, /// Key bindings for the fixup action. - pub(crate) action_fixup: Vec, + pub action_fixup: Vec, /// Key bindings for the pick action. - pub(crate) action_pick: Vec, + pub action_pick: Vec, /// Key bindings for the reword action. - pub(crate) action_reword: Vec, + pub action_reword: Vec, /// Key bindings for the squash action. - pub(crate) action_squash: Vec, + pub action_squash: Vec, /// Key bindings for positive confirmation. - pub(crate) confirm_yes: Vec, + pub confirm_yes: Vec, /// Key bindings for editing. - pub(crate) edit: Vec, + pub edit: Vec, /// Key bindings for forcing an abort. - pub(crate) force_abort: Vec, + pub force_abort: Vec, /// Key bindings for forcing a rebase. - pub(crate) force_rebase: Vec, + pub force_rebase: Vec, /// Key bindings for inserting a line. - pub(crate) insert_line: Vec, + pub insert_line: Vec, /// Key bindings for moving down. - pub(crate) move_down: Vec, + pub move_down: Vec, /// Key bindings for moving down a step. - pub(crate) move_down_step: Vec, + pub move_down_step: Vec, /// Key bindings for moving to the end. - pub(crate) move_end: Vec, + pub move_end: Vec, /// Key bindings for moving to the start. - pub(crate) move_home: Vec, + pub move_home: Vec, /// Key bindings for moving to the left. - pub(crate) move_left: Vec, + pub move_left: Vec, /// Key bindings for moving to the right. - pub(crate) move_right: Vec, + pub move_right: Vec, /// Key bindings for moving the selection down. - pub(crate) move_selection_down: Vec, + pub move_selection_down: Vec, /// Key bindings for moving the selection up. - pub(crate) move_selection_up: Vec, + pub move_selection_up: Vec, /// Key bindings for moving up. - pub(crate) move_up: Vec, + pub move_up: Vec, /// Key bindings for moving up a step. - pub(crate) move_up_step: Vec, + pub move_up_step: Vec, /// Key bindings for opening the external editor. - pub(crate) open_in_external_editor: Vec, + pub open_in_external_editor: Vec, /// Key bindings for rebasing. - pub(crate) rebase: Vec, + pub rebase: Vec, /// Key bindings for removing a line. - pub(crate) remove_line: Vec, + pub remove_line: Vec, /// Key bindings for showing a commit. - pub(crate) show_commit: Vec, + pub show_commit: Vec, /// Key bindings for showing a diff. - pub(crate) show_diff: Vec, + pub show_diff: Vec, /// Key bindings for toggling visual mode. - pub(crate) toggle_visual_mode: Vec, + pub toggle_visual_mode: Vec, /// Key bindings for the fixup specific action to toggle the c option. - pub(crate) fixup_keep_message: Vec, + pub fixup_keep_message: Vec, /// Key biding for the fixup specific action to toggle the C option. - pub(crate) fixup_keep_message_with_editor: Vec, + pub fixup_keep_message_with_editor: Vec, } impl KeyBindings { diff --git a/src/input/key_event.rs b/src/input/key_event.rs index a947e2013..7da6372bf 100644 --- a/src/input/key_event.rs +++ b/src/input/key_event.rs @@ -5,9 +5,9 @@ use crate::input::{KeyCode, KeyModifiers}; #[allow(clippy::exhaustive_structs)] pub(crate) struct KeyEvent { /// The key itself. - pub(crate) code: KeyCode, + pub code: KeyCode, /// Additional key modifiers. - pub(crate) modifiers: KeyModifiers, + pub modifiers: KeyModifiers, } impl KeyEvent { diff --git a/src/input/thread/state.rs b/src/input/thread/state.rs index 57c039596..0a482ecea 100644 --- a/src/input/thread/state.rs +++ b/src/input/thread/state.rs @@ -2,8 +2,8 @@ use std::{ collections::VecDeque, mem, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, time::Duration, }; diff --git a/src/module/module_handler.rs b/src/module/module_handler.rs index 2dd33e970..1e48eed22 100644 --- a/src/module/module_handler.rs +++ b/src/module/module_handler.rs @@ -66,14 +66,14 @@ impl ModuleHandler { } struct TestContext { - pub(crate) list: List, + list: List, module_test_context: ModuleTestContext, results: Vec, key_bindings: KeyBindings, diff --git a/src/modules/show_commit.rs b/src/modules/show_commit.rs index f04b2b075..9f00a2879 100644 --- a/src/modules/show_commit.rs +++ b/src/modules/show_commit.rs @@ -7,7 +7,7 @@ mod tests; use std::sync::Arc; -use anyhow::{anyhow, Error}; +use anyhow::{Error, anyhow}; use captur::capture; use parking_lot::Mutex; diff --git a/src/process.rs b/src/process.rs index 91cfaa464..e1d632529 100644 --- a/src/process.rs +++ b/src/process.rs @@ -8,12 +8,12 @@ use std::{ io::ErrorKind, process::Command, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, }; -use anyhow::{anyhow, Error, Result}; +use anyhow::{Error, Result, anyhow}; use parking_lot::Mutex; pub(crate) use self::{artifact::Artifact, results::Results, thread::Thread}; diff --git a/src/process/results.rs b/src/process/results.rs index a3895311f..929f0055e 100644 --- a/src/process/results.rs +++ b/src/process/results.rs @@ -11,7 +11,7 @@ use crate::{ #[derive(Debug)] pub(crate) struct Results { - pub(crate) artifacts: VecDeque, + pub artifacts: VecDeque, } impl Results { diff --git a/src/process/tests.rs b/src/process/tests.rs index 7465466af..d4e23c23a 100644 --- a/src/process/tests.rs +++ b/src/process/tests.rs @@ -6,11 +6,11 @@ use super::*; use crate::{ assert_results, input::{InputOptions, KeyBindings}, - module::{Module, DEFAULT_INPUT_OPTIONS, DEFAULT_VIEW_DATA}, + module::{DEFAULT_INPUT_OPTIONS, DEFAULT_VIEW_DATA, Module}, runtime::Status, test_helpers::{create_default_test_module_handler, create_test_module_handler, mocks, testers}, todo_file::Line, - view::{ViewData, REFRESH_THREAD_NAME}, + view::{REFRESH_THREAD_NAME, ViewData}, }; #[derive(Clone)] diff --git a/src/runtime/installer.rs b/src/runtime/installer.rs index 07ab4ed74..400a9f5ab 100644 --- a/src/runtime/installer.rs +++ b/src/runtime/installer.rs @@ -57,8 +57,8 @@ impl Debug for Installer { #[cfg(test)] mod tests { use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }; use crossbeam_channel::unbounded; diff --git a/src/runtime/runtime.rs b/src/runtime/runtime.rs index 9175ccbae..93067ca46 100644 --- a/src/runtime/runtime.rs +++ b/src/runtime/runtime.rs @@ -1,6 +1,6 @@ use std::{sync::Arc, thread}; -use crossbeam_channel::{unbounded, Receiver, Sender}; +use crossbeam_channel::{Receiver, Sender, unbounded}; use parking_lot::Mutex; use crate::runtime::{Installer, RuntimeError, Status, ThreadStatuses, Threadable}; diff --git a/src/search/state.rs b/src/search/state.rs index 0f0d76a9d..fdda6f646 100644 --- a/src/search/state.rs +++ b/src/search/state.rs @@ -1,7 +1,7 @@ use std::{ sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, time::Duration, }; diff --git a/src/test_helpers.rs b/src/test_helpers.rs index 1cbd319eb..f7ff6b2cb 100644 --- a/src/test_helpers.rs +++ b/src/test_helpers.rs @@ -24,21 +24,21 @@ mod with_view_state; pub(crate) static JAN_2021_EPOCH: i64 = 1_609_459_200; pub(crate) use self::{ - create_commit::{create_commit, CreateCommitOptions}, + create_commit::{CreateCommitOptions, create_commit}, create_config::create_config, - create_default_test_module_handler::{create_default_test_module_handler, DefaultTestModule}, + create_default_test_module_handler::{DefaultTestModule, create_default_test_module_handler}, create_event_reader::create_event_reader, create_invalid_utf::invalid_utf, create_test_keybindings::create_test_keybindings, create_test_module_handler::create_test_module_handler, shared::TestModuleProvider, - with_env_var::{with_env_var, EnvVarAction}, - with_event_handler::{with_event_handler, EventHandlerTestContext}, + with_env_var::{EnvVarAction, with_env_var}, + with_event_handler::{EventHandlerTestContext, with_event_handler}, with_git_config::with_git_config, with_git_directory::with_git_directory, - with_search::{with_search, SearchTestContext}, + with_search::{SearchTestContext, with_search}, with_temp_bare_repository::with_temp_bare_repository, with_temp_repository::with_temp_repository, with_todo_file::with_todo_file, - with_view_state::{with_view_state, ViewStateTestContext}, + with_view_state::{ViewStateTestContext, with_view_state}, }; diff --git a/src/test_helpers/assertions.rs b/src/test_helpers/assertions.rs index 5c51ebcff..edfc7ed2f 100644 --- a/src/test_helpers/assertions.rs +++ b/src/test_helpers/assertions.rs @@ -3,4 +3,4 @@ mod assert_not_empty; pub(crate) mod assert_rendered_output; mod assert_results; -pub(crate) use assert_results::{AnyArtifact, ArtifactCompareWrapper, _assert_results}; +pub(crate) use assert_results::{_assert_results, AnyArtifact, ArtifactCompareWrapper}; diff --git a/src/test_helpers/assertions/assert_rendered_output/render_view_data.rs b/src/test_helpers/assertions/assert_rendered_output/render_view_data.rs index 3eeaaeaa5..0579c6208 100644 --- a/src/test_helpers/assertions/assert_rendered_output/render_view_data.rs +++ b/src/test_helpers/assertions/assert_rendered_output/render_view_data.rs @@ -1,5 +1,5 @@ use crate::{ - test_helpers::assertions::assert_rendered_output::{render_view_line, AssertRenderOptions}, + test_helpers::assertions::assert_rendered_output::{AssertRenderOptions, render_view_line}, view::ViewData, }; diff --git a/src/test_helpers/assertions/assert_rendered_output/render_view_line.rs b/src/test_helpers/assertions/assert_rendered_output/render_view_line.rs index a54b580c8..f15b9b203 100644 --- a/src/test_helpers/assertions/assert_rendered_output/render_view_line.rs +++ b/src/test_helpers/assertions/assert_rendered_output/render_view_line.rs @@ -1,5 +1,5 @@ use crate::{ - test_helpers::assertions::assert_rendered_output::{render_style, AssertRenderOptions}, + test_helpers::assertions::assert_rendered_output::{AssertRenderOptions, render_style}, view::ViewLine, }; diff --git a/src/test_helpers/create_default_test_module_handler.rs b/src/test_helpers/create_default_test_module_handler.rs index 164d0732c..aabfaad1d 100644 --- a/src/test_helpers/create_default_test_module_handler.rs +++ b/src/test_helpers/create_default_test_module_handler.rs @@ -1,7 +1,7 @@ use crate::{ input::EventHandler, module::{Module, ModuleHandler}, - test_helpers::{create_test_keybindings, TestModuleProvider}, + test_helpers::{TestModuleProvider, create_test_keybindings}, }; pub(crate) struct DefaultTestModule; diff --git a/src/test_helpers/create_test_keybindings.rs b/src/test_helpers/create_test_keybindings.rs index 1c7e74393..dcc51e0ec 100644 --- a/src/test_helpers/create_test_keybindings.rs +++ b/src/test_helpers/create_test_keybindings.rs @@ -1,4 +1,4 @@ -use crate::input::{map_keybindings, KeyBindings}; +use crate::input::{KeyBindings, map_keybindings}; /// Create a mocked version of `KeyBindings`. #[must_use] diff --git a/src/test_helpers/testers.rs b/src/test_helpers/testers.rs index 02fddde29..d07842465 100644 --- a/src/test_helpers/testers.rs +++ b/src/test_helpers/testers.rs @@ -5,8 +5,8 @@ mod searchable; mod threadable; pub(crate) use self::{ - module::{module_test as module, ModuleTestContext}, - process::{process, ProcessTestContext}, + module::{ModuleTestContext, module_test as module}, + process::{ProcessTestContext, process}, read_event::read_event, searchable::SearchableRunner, threadable::Threadable, diff --git a/src/test_helpers/testers/module.rs b/src/test_helpers/testers/module.rs index 609e4c728..4e5211857 100644 --- a/src/test_helpers/testers/module.rs +++ b/src/test_helpers/testers/module.rs @@ -5,20 +5,21 @@ use crate::{ module::{Module, State}, process::Results, test_helpers::{ + EventHandlerTestContext, + ViewStateTestContext, with_event_handler, with_todo_file, with_view_state, - EventHandlerTestContext, - ViewStateTestContext, }, todo_file::TodoFile, view::{RenderContext, ViewData}, }; +#[allow(clippy::partial_pub_fields)] pub(crate) struct ModuleTestContext { - pub(crate) event_handler_context: EventHandlerTestContext, - pub(crate) render_context: RenderContext, - pub(crate) view_context: ViewStateTestContext, + pub event_handler_context: EventHandlerTestContext, + pub render_context: RenderContext, + pub view_context: ViewStateTestContext, todo_file: Option, } diff --git a/src/test_helpers/testers/process.rs b/src/test_helpers/testers/process.rs index be2b33ef3..42e5bbe22 100644 --- a/src/test_helpers/testers/process.rs +++ b/src/test_helpers/testers/process.rs @@ -9,22 +9,22 @@ use crate::{ process::Process, runtime::ThreadStatuses, test_helpers::{ + EventHandlerTestContext, + SearchTestContext, + ViewStateTestContext, with_event_handler, with_search, with_todo_file, with_view_state, - EventHandlerTestContext, - SearchTestContext, - ViewStateTestContext, }, }; pub(crate) struct ProcessTestContext { - pub(crate) event_handler_context: EventHandlerTestContext, - pub(crate) process: Process, - pub(crate) search_context: SearchTestContext, - pub(crate) todo_file_path: PathBuf, - pub(crate) view_context: ViewStateTestContext, + pub event_handler_context: EventHandlerTestContext, + pub process: Process, + pub search_context: SearchTestContext, + pub todo_file_path: PathBuf, + pub view_context: ViewStateTestContext, } pub(crate) fn process( diff --git a/src/test_helpers/testers/threadable.rs b/src/test_helpers/testers/threadable.rs index 8e8b40437..a30788d33 100644 --- a/src/test_helpers/testers/threadable.rs +++ b/src/test_helpers/testers/threadable.rs @@ -3,14 +3,14 @@ use std::{ borrow::BorrowMut, mem, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, thread::{sleep, spawn}, time::Duration, }; -use crossbeam_channel::{bounded, Receiver, Sender}; +use crossbeam_channel::{Receiver, Sender, bounded}; use parking_lot::Mutex; use crate::runtime::{Installer, Status, ThreadStatuses}; diff --git a/src/test_helpers/with_event_handler.rs b/src/test_helpers/with_event_handler.rs index f3ab500e3..42bb9410d 100644 --- a/src/test_helpers/with_event_handler.rs +++ b/src/test_helpers/with_event_handler.rs @@ -8,11 +8,11 @@ use crate::{ #[non_exhaustive] pub(crate) struct EventHandlerTestContext { /// The `EventHandler` instance. - pub(crate) event_handler: EventHandler, + pub event_handler: EventHandler, /// The sender instance. - pub(crate) state: State, + pub state: State, /// The number of known available events. - pub(crate) number_events: usize, + pub number_events: usize, } /// Provide an `EventHandler` instance for use within a test. diff --git a/src/test_helpers/with_git_directory.rs b/src/test_helpers/with_git_directory.rs index 5cd115875..198f02afe 100644 --- a/src/test_helpers/with_git_directory.rs +++ b/src/test_helpers/with_git_directory.rs @@ -1,6 +1,6 @@ use std::path::{Path, PathBuf}; -use crate::test_helpers::{with_env_var, EnvVarAction}; +use crate::test_helpers::{EnvVarAction, with_env_var}; pub(crate) fn with_git_directory(repo: &str, callback: C) where C: FnOnce(&str) { diff --git a/src/test_helpers/with_search.rs b/src/test_helpers/with_search.rs index c2e90364d..005f9383e 100644 --- a/src/test_helpers/with_search.rs +++ b/src/test_helpers/with_search.rs @@ -1,7 +1,7 @@ use crate::search::State; pub(crate) struct SearchTestContext { - pub(crate) state: State, + pub state: State, } pub(crate) fn with_search(callback: C) diff --git a/src/test_helpers/with_view_state.rs b/src/test_helpers/with_view_state.rs index 78b4a4014..cb66eab49 100644 --- a/src/test_helpers/with_view_state.rs +++ b/src/test_helpers/with_view_state.rs @@ -79,7 +79,7 @@ fn action_to_string(action: ViewAction) -> String { #[non_exhaustive] pub(crate) struct ViewStateTestContext { /// The state instance. - pub(crate) state: State, + pub state: State, } impl ViewStateTestContext { diff --git a/src/todo_file.rs b/src/todo_file.rs index a76001c50..1091c38d3 100644 --- a/src/todo_file.rs +++ b/src/todo_file.rs @@ -13,7 +13,7 @@ mod todo_file_options; mod utils; use std::{ - fs::{read_to_string, File}, + fs::{File, read_to_string}, io::Write, path::{Path, PathBuf}, slice::Iter, diff --git a/src/todo_file/history/history_item.rs b/src/todo_file/history/history_item.rs index f85276d71..a0560208c 100644 --- a/src/todo_file/history/history_item.rs +++ b/src/todo_file/history/history_item.rs @@ -2,10 +2,10 @@ use crate::todo_file::{Line, Operation}; #[derive(Debug, PartialEq, Eq)] pub(crate) struct HistoryItem { - pub(crate) start_index: usize, - pub(crate) end_index: usize, - pub(crate) operation: Operation, - pub(crate) lines: Vec, + pub start_index: usize, + pub end_index: usize, + pub operation: Operation, + pub lines: Vec, } impl HistoryItem { diff --git a/src/todo_file/todo_file_options.rs b/src/todo_file/todo_file_options.rs index bc057bba2..5846889b6 100644 --- a/src/todo_file/todo_file_options.rs +++ b/src/todo_file/todo_file_options.rs @@ -1,9 +1,9 @@ /// Options for `TodoFile` #[derive(Debug, Clone, PartialEq, Eq)] pub(crate) struct TodoFileOptions { - pub(crate) comment_prefix: String, - pub(crate) line_changed_command: Option, - pub(crate) undo_limit: u32, + pub comment_prefix: String, + pub line_changed_command: Option, + pub undo_limit: u32, } impl TodoFileOptions { diff --git a/src/view.rs b/src/view.rs index fba424087..d1716df26 100644 --- a/src/view.rs +++ b/src/view.rs @@ -31,7 +31,7 @@ pub(crate) use self::{ render_context::RenderContext, render_slice::RenderSlice, scroll_position::ScrollPosition, - thread::{State, Thread, ViewAction, REFRESH_THREAD_NAME}, + thread::{REFRESH_THREAD_NAME, State, Thread, ViewAction}, view_data::ViewData, view_data_updater::ViewDataUpdater, view_line::ViewLine, diff --git a/src/view/render_slice/tests.rs b/src/view/render_slice/tests.rs index d58553272..0b8ced204 100644 --- a/src/view/render_slice/tests.rs +++ b/src/view/render_slice/tests.rs @@ -3,10 +3,10 @@ use crate::{ display::DisplayColor, test_helpers::assertions::assert_rendered_output::{ _assert_rendered_output, - render_view_line, AssertRenderOptions, ExactPattern, LinePattern, + render_view_line, }, view::LineSegmentOptions, }; diff --git a/src/view/thread/state.rs b/src/view/thread/state.rs index bdbf35ecc..85a66ff90 100644 --- a/src/view/thread/state.rs +++ b/src/view/thread/state.rs @@ -1,8 +1,8 @@ use std::{ borrow::BorrowMut, sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }, }; @@ -13,11 +13,12 @@ use crate::view::{RenderSlice, ViewAction, ViewData}; /// Represents a message sender and receiver for passing actions between threads. #[derive(Clone, Debug)] +#[allow(clippy::partial_pub_fields)] pub(crate) struct State { ended: Arc, paused: Arc, render_slice: Arc>, - pub(crate) update_receiver: crossbeam_channel::Receiver, + pub update_receiver: crossbeam_channel::Receiver, update_sender: crossbeam_channel::Sender, }