fn compare_dirs<P: AsRef<Path>, Q: AsRef<Path>>(path1: P, path2: Q) -> Result<(), String> {
	// rsync should compare mtime, permissions, contents, etc.
	let output = Command::new("rsync")
		.arg("-avnci")     // Archive mode, verbose, dry-run, checksum, itemized list
		.arg("--delete")  // Check for missing files
		.arg(path1.as_ref().to_str().unwrap().to_string() + "/")
		.arg(path2.as_ref().to_str().unwrap().to_string() + "/")
		.output().unwrap();

	let output = String::from_utf8_lossy(&output.stdout);
	let same = parse_rsync_output(&output);

	if same {
		Ok(())
	} else {
		Err(output.to_string())
	}
}
// Compares the given directories using rsync.
// The returned error String is the output of rsync when they don't match.
Compares the given directories using rsync.
The returned error String is the output of rsync when they don't match.
Compares the given directories using rsync . The returned error String is the output of rsync when they don ' t match .
fn compare_dirs<P: AsRef<Path>, Q: AsRef<Path>>(path1: P, path2: Q) -> Result<(), String> {
	// rsync should compare mtime, permissions, contents, etc.
	let output = Command::new("rsync")
		.arg("-avnci")     // Archive mode, verbose, dry-run, checksum, itemized list
		.arg("--delete")  // Check for missing files
		.arg(path1.as_ref().to_str().unwrap().to_string() + "/")
		.arg(path2.as_ref().to_str().unwrap().to_string() + "/")
		.output().unwrap();
	let output = String::from_utf8_lossy(&output.stdout);
	let same = parse_rsync_output(&output);
	if same {
		Ok(())
	} else {
		Err(output.to_string())
	}
}
fn compare_dirs < P : AsRef < Path > , Q : AsRef < Path > > ( path1 : P , path2 : Q ) -> Result < ( ) , String > { // rsync should compare mtime, permissions, contents, etc. let output = Command :: new ( " " ) . arg ( " " ) // Archive mode, verbose, dry-run, checksum, itemized list . arg ( " " ) // Check for missing files . arg ( path1 . as_ref ( ) . to_str ( ) . unwrap ( ) . to_string ( ) + " " ) . arg ( path2 . as_ref ( ) . to_str ( ) . unwrap ( ) . to_string ( ) + " " ) . output ( ) . unwrap ( ) ; let output = String :: from_utf8_lossy ( & output . stdout ) ; let same = parse_rsync_output ( & output ) ; if same { Ok ( ( ) ) } else { Err ( output . to_string ( ) ) } }
Compares the given directories using rsync.
Compares the given directories using rsync .
path1
P
path2
Q
path1
P
path2
Q