Skip to content

Commit

Permalink
Refactor: sort struct entries
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jul 29, 2020
1 parent c573382 commit e159b43
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ pub struct Config {
pub file_renamed_label: String,
pub file_style: Style,
pub git_config_entries: HashMap<String, GitConfigEntry>,
pub keep_plus_minus_markers: bool,
pub hunk_header_style: Style,
pub hyperlinks: bool,
pub hyperlinks_file_link_format: String,
pub keep_plus_minus_markers: bool,
pub line_numbers: bool,
pub line_numbers_left_format: String,
pub line_numbers_left_style: Style,
pub line_numbers_minus_style: Style,
pub line_numbers_plus_style: Style,
pub line_numbers_right_format: String,
pub line_numbers_right_style: Style,
pub line_numbers_zero_style: Style,
pub max_buffered_lines: usize,
pub max_line_distance: f64,
pub max_line_distance_for_naively_paired_lines: f64,
Expand All @@ -43,29 +51,21 @@ pub struct Config {
pub navigate: bool,
pub null_style: Style,
pub null_syntect_style: SyntectStyle,
pub line_numbers_left_format: String,
pub line_numbers_left_style: Style,
pub line_numbers_minus_style: Style,
pub line_numbers_plus_style: Style,
pub line_numbers_right_format: String,
pub line_numbers_right_style: Style,
pub line_numbers_zero_style: Style,
pub paging_mode: PagingMode,
pub plus_emph_style: Style,
pub plus_empty_line_marker_style: Style,
pub plus_file: Option<PathBuf>,
pub plus_non_emph_style: Style,
pub plus_style: Style,
pub line_numbers: bool,
pub side_by_side: bool,
pub side_by_side_data: side_by_side::SideBySideData,
pub syntax_dummy_theme: SyntaxTheme,
pub syntax_set: SyntaxSet,
pub syntax_theme: Option<SyntaxTheme>,
pub tab_width: usize,
pub tokenization_regex: Regex,
pub true_color: bool,
pub truncation_symbol: String,
pub tokenization_regex: Regex,
pub whitespace_error_style: Style,
pub zero_style: Style,
}
Expand Down Expand Up @@ -140,10 +140,18 @@ impl From<cli::Opt> for Config {
file_renamed_label: opt.file_renamed_label,
file_style,
git_config_entries: opt.git_config_entries,
keep_plus_minus_markers: opt.keep_plus_minus_markers,
hunk_header_style,
hyperlinks: opt.hyperlinks,
hyperlinks_file_link_format: opt.hyperlinks_file_link_format,
keep_plus_minus_markers: opt.keep_plus_minus_markers,
line_numbers: opt.line_numbers,
line_numbers_left_format: opt.line_numbers_left_format,
line_numbers_left_style,
line_numbers_minus_style,
line_numbers_plus_style,
line_numbers_right_format: opt.line_numbers_right_format,
line_numbers_right_style,
line_numbers_zero_style,
max_buffered_lines: 32,
max_line_distance: opt.max_line_distance,
max_line_distance_for_naively_paired_lines,
Expand All @@ -155,20 +163,12 @@ impl From<cli::Opt> for Config {
navigate: opt.navigate,
null_style: Style::new(),
null_syntect_style: SyntectStyle::default(),
line_numbers_left_format: opt.line_numbers_left_format,
line_numbers_left_style,
line_numbers_minus_style,
line_numbers_plus_style,
line_numbers_right_format: opt.line_numbers_right_format,
line_numbers_right_style,
line_numbers_zero_style,
paging_mode: opt.computed.paging_mode,
plus_emph_style,
plus_empty_line_marker_style,
plus_file: opt.plus_file.map(|s| s.clone()),
plus_non_emph_style,
plus_style,
line_numbers: opt.line_numbers,
side_by_side: opt.side_by_side,
side_by_side_data,
syntax_dummy_theme: SyntaxTheme::default(),
Expand Down

0 comments on commit e159b43

Please sign in to comment.