Refactor export and add page length
This commit is contained in:
parent
d910047b48
commit
f71092058b
3 changed files with 123 additions and 74 deletions
|
|
@ -6,15 +6,15 @@ use crate::data::AdjacencyList;
|
|||
|
||||
pub fn reexport(from: &Path, to: &Path) -> io::Result<()> {
|
||||
eprintln!(">> Import");
|
||||
let from = BufReader::new(File::open(from)?);
|
||||
let data = AdjacencyList::read(from)?;
|
||||
let mut from = BufReader::new(File::open(from)?);
|
||||
let data = AdjacencyList::read(&mut from)?;
|
||||
|
||||
eprintln!(">> Consistency check");
|
||||
data.check_consistency();
|
||||
|
||||
eprintln!(">> Export");
|
||||
let to = BufWriter::new(File::create(to)?);
|
||||
data.write(to)?;
|
||||
let mut to = BufWriter::new(File::create(to)?);
|
||||
data.write(&mut to)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue