diff --git a/src/config/file.rs b/src/config/file.rs index 80895134f1..21565c3659 100644 --- a/src/config/file.rs +++ b/src/config/file.rs @@ -46,7 +46,7 @@ pub struct FileConfig { // TODO: Rewrite impls impl FileConfig { - pub(crate) fn create>(self, prefix: P) -> Result<()> { + pub(crate) fn create>(&self, prefix: P) -> Result<()> { let path = self.path.trim_start_matches('/'); let target_file = prefix.as_ref() .join(path); diff --git a/src/lib.rs b/src/lib.rs index 78f2d61ad7..e990e9baf7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,12 +172,12 @@ pub fn install_dir, S: AsRef>(config: Config, output_dir: P, let output_dir = output_dir.to_owned(); - install_packages(&config, output_dir.to_str().unwrap(), cookbook); - - for file in config.files { + for file in &config.files { file.create(&output_dir)?; } + install_packages(&config, output_dir.to_str().unwrap(), cookbook); + let mut passwd = String::new(); let mut shadow = String::new(); let mut next_uid = 1000;