そのコードでCursor使う意味が分からん
let mut tar = tar::Builder::new(Vec::new());
tar.append_path("foo.txt").unwrap();
let body = tar.into_inner().unwrap();
std::fs::write("foo.tar", body).unwrap();