Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #17] Stop consuming the content #18

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn run() -> Result<(), Error> {
FormOpts::from_args().context("could not parse the command line arguments")?;
// if None, we've already printed a help text or version and have nothing more to do
if let Some(opts) = try_parsed_args {
create_directory_structure(opts.output_dir, opts.input)?;
create_directory_structure(opts.output_dir, &opts.input)?;
println!("Completed successfully");
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use failure::*;

pub fn create_directory_structure<P: AsRef<Path>>(
base_dir: P,
string_contents: String,
string_contents: &str,
) -> Result<(), Error> {
info!("Started parsing the input as Rust. This can take a minute or two.");
let parsed_crate = syn::parse_file(&string_contents)
Expand Down
2 changes: 1 addition & 1 deletion tests/file-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn test_from_reference_files() {
let expected_ac3 = include_bytes!("resources/after/ac/ac2/ac3.rs");

let lib_dir = tempdir().unwrap();
create_directory_structure(lib_dir.path(), before_file.to_string()).unwrap();
create_directory_structure(lib_dir.path(), before_file).unwrap();

compare_to_expected(expected_lib, lib_dir.path().join("lib.rs"));
compare_to_expected(expected_interrupt, lib_dir.path().join("interrupt.rs"));
Expand Down