run cargo fmt

This commit is contained in:
2022-11-27 22:32:10 +01:00
parent fd59f25fea
commit 6a488f77db
3 changed files with 23 additions and 23 deletions

View File

@ -57,38 +57,38 @@ impl From<ResultU16Info> for ResultU16InfoSerializable {
#[cfg(feature = "std")]
pub mod stdmod {
use std::path::Path;
use std::io;
use super::*;
use std::io;
use std::path::Path;
pub fn print_resultcodes_as_csv(codes: &[ResultU16Info]) -> Result<(), csv::Error> {
let mut wtr = csv::Writer::from_writer(io::stdout());
for result in codes {
wtr.serialize(ResultU16InfoSerializable::from(*result))?;
let mut wtr = csv::Writer::from_writer(io::stdout());
for result in codes {
wtr.serialize(ResultU16InfoSerializable::from(*result))?;
}
wtr.flush()?;
Ok(())
}
pub fn write_resultcodes_to_csv(
results: &[ResultU16Info],
path: impl AsRef<Path>,
) -> Result<(), csv::Error> {
let mut wtr = csv::Writer::from_path(path)?;
for result_code in results {
wtr.serialize(ResultU16InfoSerializable::from(*result_code))?;
}
wtr.flush()?;
Ok(())
}
wtr.flush()?;
Ok(())
}
pub fn write_resultcodes_to_csv(
results: &[ResultU16Info],
path: impl AsRef<Path>,
) -> Result<(), csv::Error> {
let mut wtr = csv::Writer::from_path(path)?;
for result_code in results {
wtr.serialize(ResultU16InfoSerializable::from(*result_code))?;
}
wtr.flush()?;
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::fs::File;
use std::path::Path;
use std::io::{BufRead, BufReader};
use std::path::Path;
// Special solution for this crate because the code generated by a macro will use
// satrs_mib::res_code::*
use crate as satrs_mib;