Fixes mut issue

This commit is contained in:
ms2300 2018-08-27 13:43:22 -06:00 committed by David Peter
parent f3dde0185d
commit 5444b0dfed
4 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ pub enum PagingMode {
Never, Never,
} }
#[derive(Clone)]
pub struct Config<'a> { pub struct Config<'a> {
/// List of files to print /// List of files to print
pub files: Vec<Option<&'a str>>, pub files: Vec<Option<&'a str>>,

View File

@ -1,5 +1,6 @@
use errors::*; use errors::*;
#[derive(Clone)]
pub struct LineRange { pub struct LineRange {
pub lower: usize, pub lower: usize,
pub upper: usize, pub upper: usize,

View File

@ -149,7 +149,7 @@ fn run() -> Result<bool> {
Ok(true) Ok(true)
} }
_ => { _ => {
let mut config = app.config()?; let config = app.config()?;
let assets = HighlightingAssets::new(); let assets = HighlightingAssets::new();
if app.matches.is_present("list-languages") { if app.matches.is_present("list-languages") {
@ -157,7 +157,7 @@ fn run() -> Result<bool> {
Ok(true) Ok(true)
} else if app.matches.is_present("list-themes") { } else if app.matches.is_present("list-themes") {
list_themes(&assets, &mut config); list_themes(&assets, &mut config.clone());
Ok(true) Ok(true)
} else { } else {

View File

@ -59,6 +59,7 @@ impl FromStr for OutputComponent {
} }
} }
#[derive(Clone)]
pub struct OutputComponents(pub HashSet<OutputComponent>); pub struct OutputComponents(pub HashSet<OutputComponent>);
impl OutputComponents { impl OutputComponents {