Compare commits
2 Commits
ac0aa99ba8
...
eac109379e
| Author | SHA1 | Date | |
|---|---|---|---|
| eac109379e | |||
| 092658b039 |
@@ -51,14 +51,12 @@ impl Rewriter {
|
||||
// Create the directory, then carry on. Note that we explore the
|
||||
// src_path after creating dst_path.
|
||||
fs::create_dir(&dst_path)?;
|
||||
println!("mkdir {:?}", dst_path);
|
||||
to_visit.push(src_path.into_os_string().into_string().unwrap());
|
||||
continue;
|
||||
}
|
||||
|
||||
// Open 2 files; one to read and translate, and one to write.
|
||||
let source_file = File::open(&src_path)?;
|
||||
println!("touch {:?}", dst_path);
|
||||
let mut dest_file = File::create(&dst_path)?;
|
||||
let reader = BufReader::new(source_file);
|
||||
|
||||
@@ -67,7 +65,6 @@ impl Rewriter {
|
||||
// If the line is not subject to replacement, copy it and
|
||||
// carry on.
|
||||
if !line.contains(&self.source) {
|
||||
println!("{}", line);
|
||||
writeln!(dest_file, "{}", line)?;
|
||||
continue;
|
||||
}
|
||||
@@ -76,7 +73,6 @@ impl Rewriter {
|
||||
// in question
|
||||
for replacement in &replacements {
|
||||
let new_line = line.replace(&self.source, &replacement);
|
||||
println!("{}", new_line);
|
||||
writeln!(dest_file, "{}", new_line)?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user