pub(crate) fn write_file(
    rel: &[impl Serialize],
    writer: impl Write,
    file_type: ArgFileType
) -> Result<(), Box<dyn Error>>