mirror of
https://github.com/132nd-vWing/tacview-splitter.git
synced 2026-08-26 07:48:37 +02:00
Descriptors: constructor is now generic
This commit is contained in:
+2
-2
@@ -66,7 +66,7 @@ pub mod lib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Descriptors<fs::File> {
|
impl Descriptors<fs::File> {
|
||||||
pub fn new_for_file(filenames: OutputFilenames) -> Descriptors<fs::File> {
|
pub fn new(filenames: OutputFilenames) -> Descriptors<fs::File> {
|
||||||
let blue = fs::File::create(&filenames.txt.blue).expect(ERR_CANNOT_OPEN_OUTPUT);
|
let blue = fs::File::create(&filenames.txt.blue).expect(ERR_CANNOT_OPEN_OUTPUT);
|
||||||
let red = fs::File::create(&filenames.txt.red).expect(ERR_CANNOT_OPEN_OUTPUT);
|
let red = fs::File::create(&filenames.txt.red).expect(ERR_CANNOT_OPEN_OUTPUT);
|
||||||
let violet = fs::File::create(&filenames.txt.violet).expect(ERR_CANNOT_OPEN_OUTPUT);
|
let violet = fs::File::create(&filenames.txt.violet).expect(ERR_CANNOT_OPEN_OUTPUT);
|
||||||
@@ -76,7 +76,7 @@ pub mod lib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Descriptors<zip::ZipWriter<fs::File>> {
|
impl Descriptors<zip::ZipWriter<fs::File>> {
|
||||||
pub fn new_for_zip(filenames: OutputFilenames) -> Descriptors<zip::ZipWriter<fs::File>> {
|
pub fn new(filenames: OutputFilenames) -> Descriptors<zip::ZipWriter<fs::File>> {
|
||||||
let options = zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
let options = zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
||||||
|
|
||||||
let file = fs::File::create(&filenames.zip.blue).expect(ERR_CANNOT_OPEN_OUTPUT);
|
let file = fs::File::create(&filenames.zip.blue).expect(ERR_CANNOT_OPEN_OUTPUT);
|
||||||
|
|||||||
+2
-2
@@ -24,10 +24,10 @@ fn main() {
|
|||||||
|
|
||||||
let output_filenames = get_output_filenames(&input_filename);
|
let output_filenames = get_output_filenames(&input_filename);
|
||||||
if is_zip {
|
if is_zip {
|
||||||
let mut descriptors = lib::Descriptors::new_for_zip(output_filenames);
|
let mut descriptors = lib::Descriptors::<zip::ZipWriter<fs::File>>::new(output_filenames);
|
||||||
descriptors.write(header, bodies_by_coalition);
|
descriptors.write(header, bodies_by_coalition);
|
||||||
} else {
|
} else {
|
||||||
let mut descriptors = lib::Descriptors::new_for_file(output_filenames);
|
let mut descriptors = lib::Descriptors::<fs::File>::new(output_filenames);
|
||||||
descriptors.write(header, bodies_by_coalition);
|
descriptors.write(header, bodies_by_coalition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user