Skip to content

Commit 8d4f2c5

Browse files
committed
Make pub(crate) fields of pub(crate) structs public
This doesn't change whether the fields are accessible outside the crate, and avoids clippy warnings: warning: scoped visibility modifier on a field --> src/input/key_bindings.rs:44:2 | 44 | pub(crate) action_drop: Vec<Event>, | ^^^^^^^^^^ | = help: consider making the field private and adding a scoped visibility method for it = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_scoped_visibility_modifiers
1 parent 1bfb569 commit 8d4f2c5

File tree

12 files changed

+160
-159
lines changed

12 files changed

+160
-159
lines changed

src/config.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,29 @@ const DEFAULT_TAB_SYMBOL: &str = "\u{2192}"; // →
4141
#[non_exhaustive]
4242
pub(crate) struct Config {
4343
/// If to select the next line in the list after performing an action.
44-
pub(crate) auto_select_next: bool,
44+
pub auto_select_next: bool,
4545
/// How to handle whitespace when calculating diffs.
46-
pub(crate) diff_ignore_whitespace: DiffIgnoreWhitespaceSetting,
46+
pub diff_ignore_whitespace: DiffIgnoreWhitespaceSetting,
4747
/// If to ignore blank lines when calculating diffs.
48-
pub(crate) diff_ignore_blank_lines: bool,
48+
pub diff_ignore_blank_lines: bool,
4949
/// How to show whitespace in diffs.
50-
pub(crate) diff_show_whitespace: DiffShowWhitespaceSetting,
50+
pub diff_show_whitespace: DiffShowWhitespaceSetting,
5151
/// The symbol used to replace space characters.
52-
pub(crate) diff_space_symbol: String,
52+
pub diff_space_symbol: String,
5353
/// The symbol used to replace tab characters.
54-
pub(crate) diff_tab_symbol: String,
54+
pub diff_tab_symbol: String,
5555
/// The display width of the tab character.
56-
pub(crate) diff_tab_width: u32,
56+
pub diff_tab_width: u32,
5757
/// If set, automatically add an exec line with the command after every modified line
58-
pub(crate) post_modified_line_exec_command: Option<String>,
58+
pub post_modified_line_exec_command: Option<String>,
5959
/// The maximum number of undo steps.
60-
pub(crate) undo_limit: u32,
60+
pub undo_limit: u32,
6161
/// Configuration options loaded directly from Git.
62-
pub(crate) git: GitConfig,
62+
pub git: GitConfig,
6363
/// Key binding configuration.
64-
pub(crate) key_bindings: KeyBindings,
64+
pub key_bindings: KeyBindings,
6565
/// Theme configuration.
66-
pub(crate) theme: Theme,
66+
pub theme: Theme,
6767
}
6868

6969
impl Config {

src/config/git_config.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,31 @@ pub(crate) struct GitConfig {
2828
/// The Git comment character, from [`core.commentChar`](
2929
/// https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar
3030
/// ).
31-
pub(crate) comment_char: String,
31+
pub comment_char: String,
3232
/// Number of context lines, from [`diff.context`](
3333
/// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffcontext
3434
/// ).
35-
pub(crate) diff_context: u32,
35+
pub diff_context: u32,
3636
/// Number of interhunk lines, from [`diff.interhunk_lines`](
3737
/// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffinterHunkContext
3838
/// ).
39-
pub(crate) diff_interhunk_lines: u32,
39+
pub diff_interhunk_lines: u32,
4040
/// The limit for detecting renames, from [`diff.renameLimit`](
4141
/// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffrenameLimit
4242
/// ).
43-
pub(crate) diff_rename_limit: u32,
43+
pub diff_rename_limit: u32,
4444
/// If to detect renames, from [`diff.renames`](
4545
/// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffrenames
4646
/// ).
47-
pub(crate) diff_renames: bool,
47+
pub diff_renames: bool,
4848
/// If to detect copies, from [`diff.renames`](
4949
/// https://git-scm.com/docs/diff-config/#Documentation/diff-config.txt-diffrenames
5050
/// ).
51-
pub(crate) diff_copies: bool,
51+
pub diff_copies: bool,
5252
/// The Git editor, from [`core.editor`](
5353
/// https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreeditor
5454
/// ).
55-
pub(crate) editor: String,
55+
pub editor: String,
5656
}
5757

5858
impl GitConfig {

src/config/key_bindings.rs

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,100 +17,100 @@ fn map_single_ascii_to_lower(s: &str) -> String {
1717
#[non_exhaustive]
1818
pub(crate) struct KeyBindings {
1919
/// Key bindings for aborting.
20-
pub(crate) abort: Vec<String>,
20+
pub abort: Vec<String>,
2121
/// Key bindings for the break action.
22-
pub(crate) action_break: Vec<String>,
22+
pub action_break: Vec<String>,
2323
/// Key bindings for the drop action.
24-
pub(crate) action_drop: Vec<String>,
24+
pub action_drop: Vec<String>,
2525
/// Key bindings for the edit action.
26-
pub(crate) action_edit: Vec<String>,
26+
pub action_edit: Vec<String>,
2727
/// Key bindings for the fixup action.
28-
pub(crate) action_fixup: Vec<String>,
28+
pub action_fixup: Vec<String>,
2929
/// Key bindings for the pick action.
30-
pub(crate) action_pick: Vec<String>,
30+
pub action_pick: Vec<String>,
3131
/// Key bindings for the reword action.
32-
pub(crate) action_reword: Vec<String>,
32+
pub action_reword: Vec<String>,
3333
/// Key bindings for the squash action.
34-
pub(crate) action_squash: Vec<String>,
34+
pub action_squash: Vec<String>,
3535
/// Key bindings for negative confirmation.
36-
pub(crate) confirm_no: Vec<String>,
36+
pub confirm_no: Vec<String>,
3737
/// Key bindings for positive confirmation.
38-
pub(crate) confirm_yes: Vec<String>,
38+
pub confirm_yes: Vec<String>,
3939
/// Key bindings for editing.
40-
pub(crate) edit: Vec<String>,
40+
pub edit: Vec<String>,
4141
/// Key bindings for forcing a abort.
42-
pub(crate) force_abort: Vec<String>,
42+
pub force_abort: Vec<String>,
4343
/// Key bindings for forcing a rebase.
44-
pub(crate) force_rebase: Vec<String>,
44+
pub force_rebase: Vec<String>,
4545
/// Key bindings for showing help.
46-
pub(crate) help: Vec<String>,
46+
pub help: Vec<String>,
4747
/// Key bindings for inserting a line.
48-
pub(crate) insert_line: Vec<String>,
48+
pub insert_line: Vec<String>,
4949

5050
/// Key bindings for moving down.
51-
pub(crate) move_down: Vec<String>,
51+
pub move_down: Vec<String>,
5252
/// Key bindings for moving to the end.
53-
pub(crate) move_end: Vec<String>,
53+
pub move_end: Vec<String>,
5454
/// Key bindings for moving to the start.
55-
pub(crate) move_home: Vec<String>,
55+
pub move_home: Vec<String>,
5656
/// Key bindings for moving to the left.
57-
pub(crate) move_left: Vec<String>,
57+
pub move_left: Vec<String>,
5858
/// Key bindings for moving to the right.
59-
pub(crate) move_right: Vec<String>,
59+
pub move_right: Vec<String>,
6060
/// Key bindings for moving up.
61-
pub(crate) move_up: Vec<String>,
61+
pub move_up: Vec<String>,
6262
/// Key bindings for moving down a step.
63-
pub(crate) move_down_step: Vec<String>,
63+
pub move_down_step: Vec<String>,
6464
/// Key bindings for moving up a step.
65-
pub(crate) move_up_step: Vec<String>,
65+
pub move_up_step: Vec<String>,
6666
/// Key bindings for moving the selection down.
67-
pub(crate) move_selection_down: Vec<String>,
67+
pub move_selection_down: Vec<String>,
6868
/// Key bindings for moving the selection up.
69-
pub(crate) move_selection_up: Vec<String>,
69+
pub move_selection_up: Vec<String>,
7070

7171
/// Key bindings for scrolling down.
72-
pub(crate) scroll_down: Vec<String>,
72+
pub scroll_down: Vec<String>,
7373
/// Key bindings for scrolling to the end.
74-
pub(crate) scroll_end: Vec<String>,
74+
pub scroll_end: Vec<String>,
7575
/// Key bindings for scrolling to the start.
76-
pub(crate) scroll_home: Vec<String>,
76+
pub scroll_home: Vec<String>,
7777
/// Key bindings for scrolling to the left.
78-
pub(crate) scroll_left: Vec<String>,
78+
pub scroll_left: Vec<String>,
7979
/// Key bindings for scrolling to the right.
80-
pub(crate) scroll_right: Vec<String>,
80+
pub scroll_right: Vec<String>,
8181
/// Key bindings for scrolling up.
82-
pub(crate) scroll_up: Vec<String>,
82+
pub scroll_up: Vec<String>,
8383
/// Key bindings for scrolling down a step.
84-
pub(crate) scroll_step_down: Vec<String>,
84+
pub scroll_step_down: Vec<String>,
8585
/// Key bindings for scrolling up a step.
86-
pub(crate) scroll_step_up: Vec<String>,
86+
pub scroll_step_up: Vec<String>,
8787

8888
/// Key bindings for opening the external editor.
89-
pub(crate) open_in_external_editor: Vec<String>,
89+
pub open_in_external_editor: Vec<String>,
9090
/// Key bindings for rebasing.
91-
pub(crate) rebase: Vec<String>,
91+
pub rebase: Vec<String>,
9292
/// Key bindings for redoing a change.
93-
pub(crate) redo: Vec<String>,
93+
pub redo: Vec<String>,
9494
/// Key bindings for removing a line.
95-
pub(crate) remove_line: Vec<String>,
95+
pub remove_line: Vec<String>,
9696
/// Key bindings for starting search.
97-
pub(crate) search_start: Vec<String>,
97+
pub search_start: Vec<String>,
9898
/// Key bindings for next search match.
99-
pub(crate) search_next: Vec<String>,
99+
pub search_next: Vec<String>,
100100
/// Key bindings for previous search match.
101-
pub(crate) search_previous: Vec<String>,
101+
pub search_previous: Vec<String>,
102102
/// Key bindings for showing a commit.
103-
pub(crate) show_commit: Vec<String>,
103+
pub show_commit: Vec<String>,
104104
/// Key bindings for showing a diff.
105-
pub(crate) show_diff: Vec<String>,
105+
pub show_diff: Vec<String>,
106106
/// Key bindings for toggling visual mode.
107-
pub(crate) toggle_visual_mode: Vec<String>,
107+
pub toggle_visual_mode: Vec<String>,
108108
/// Key bindings for undoing a change.
109-
pub(crate) undo: Vec<String>,
109+
pub undo: Vec<String>,
110110
/// Key bindings for the fixup specific action to toggle the c option.
111-
pub(crate) fixup_keep_message_with_editor: Vec<String>,
111+
pub fixup_keep_message_with_editor: Vec<String>,
112112
/// Key bindings for the fixup specific action to toggle the c option.
113-
pub(crate) fixup_keep_message: Vec<String>,
113+
pub fixup_keep_message: Vec<String>,
114114
}
115115

116116
impl KeyBindings {

src/config/theme.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,49 +28,49 @@ fn get_color(config: Option<&Config>, name: &str, default: Color) -> Result<Colo
2828
#[non_exhaustive]
2929
pub(crate) struct Theme {
3030
/// The character for filling vertical spacing.
31-
pub(crate) character_vertical_spacing: String,
31+
pub character_vertical_spacing: String,
3232
/// The color for the break action.
33-
pub(crate) color_action_break: Color,
33+
pub color_action_break: Color,
3434
/// The color for the drop action.
35-
pub(crate) color_action_drop: Color,
35+
pub color_action_drop: Color,
3636
/// The color for the edit action.
37-
pub(crate) color_action_edit: Color,
37+
pub color_action_edit: Color,
3838
/// The color for the exec action.
39-
pub(crate) color_action_exec: Color,
39+
pub color_action_exec: Color,
4040
/// The color for the fixup action.
41-
pub(crate) color_action_fixup: Color,
41+
pub color_action_fixup: Color,
4242
/// The color for the pick action.
43-
pub(crate) color_action_pick: Color,
43+
pub color_action_pick: Color,
4444
/// The color for the reword action.
45-
pub(crate) color_action_reword: Color,
45+
pub color_action_reword: Color,
4646
/// The color for the squash action.
47-
pub(crate) color_action_squash: Color,
47+
pub color_action_squash: Color,
4848
/// The color for the label action.
49-
pub(crate) color_action_label: Color,
49+
pub color_action_label: Color,
5050
/// The color for the reset action.
51-
pub(crate) color_action_reset: Color,
51+
pub color_action_reset: Color,
5252
/// The color for the merge action.
53-
pub(crate) color_action_merge: Color,
53+
pub color_action_merge: Color,
5454
/// The color for the update-ref action.
55-
pub(crate) color_action_update_ref: Color,
55+
pub color_action_update_ref: Color,
5656
/// The color for the background.
57-
pub(crate) color_background: Color,
57+
pub color_background: Color,
5858
/// The color for added lines in a diff.
59-
pub(crate) color_diff_add: Color,
59+
pub color_diff_add: Color,
6060
/// The color for changed lines in a diff.
61-
pub(crate) color_diff_change: Color,
61+
pub color_diff_change: Color,
6262
/// The color for context lines in a diff.
63-
pub(crate) color_diff_context: Color,
63+
pub color_diff_context: Color,
6464
/// The color for removed lines in a diff.
65-
pub(crate) color_diff_remove: Color,
65+
pub color_diff_remove: Color,
6666
/// The color for whitespace characters in a diff.
67-
pub(crate) color_diff_whitespace: Color,
67+
pub color_diff_whitespace: Color,
6868
/// The color for the standard text.
69-
pub(crate) color_foreground: Color,
69+
pub color_foreground: Color,
7070
/// The color for indicator text.
71-
pub(crate) color_indicator: Color,
71+
pub color_indicator: Color,
7272
/// The background color for selected lines.
73-
pub(crate) color_selected_background: Color,
73+
pub color_selected_background: Color,
7474
}
7575

7676
impl Theme {

src/git/commit.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ use crate::git::{GitError, Reference, User};
55
/// Represents a commit.
66
#[derive(Debug, PartialEq, Eq)]
77
pub(crate) struct Commit {
8-
pub(crate) hash: String,
9-
pub(crate) reference: Option<Reference>,
10-
pub(crate) author: User,
11-
pub(crate) authored_date: Option<DateTime<Local>>,
12-
pub(crate) message: Option<String>,
13-
pub(crate) committer: Option<User>,
14-
pub(crate) committed_date: DateTime<Local>,
15-
pub(crate) summary: Option<String>,
8+
pub hash: String,
9+
pub reference: Option<Reference>,
10+
pub author: User,
11+
pub authored_date: Option<DateTime<Local>>,
12+
pub message: Option<String>,
13+
pub committer: Option<User>,
14+
pub committed_date: DateTime<Local>,
15+
pub summary: Option<String>,
1616
}
1717

1818
impl Commit {

src/git/commit_diff_loader_options.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#[derive(Copy, Clone, Debug)]
33
#[allow(clippy::struct_excessive_bools)]
44
pub(crate) struct CommitDiffLoaderOptions {
5-
pub(crate) context_lines: u32,
6-
pub(crate) copies: bool,
7-
pub(crate) ignore_whitespace: bool,
8-
pub(crate) ignore_whitespace_change: bool,
9-
pub(crate) ignore_blank_lines: bool,
10-
pub(crate) interhunk_context: u32,
11-
pub(crate) rename_limit: u32,
12-
pub(crate) renames: bool,
5+
pub context_lines: u32,
6+
pub copies: bool,
7+
pub ignore_whitespace: bool,
8+
pub ignore_whitespace_change: bool,
9+
pub ignore_blank_lines: bool,
10+
pub interhunk_context: u32,
11+
pub rename_limit: u32,
12+
pub renames: bool,
1313
}
1414

1515
impl CommitDiffLoaderOptions {

0 commit comments

Comments
 (0)