run cargo fmt

This commit is contained in:
Robin Müller 2022-11-27 22:32:10 +01:00
parent fd59f25fea
commit 6a488f77db
No known key found for this signature in database
GPG Key ID: BE6480244DFE612C
3 changed files with 23 additions and 23 deletions

View File

@ -1,7 +1,7 @@
use std::net::Ipv4Addr;
use satrs_mib::resultcode;
use satrs_mib::res_code::{ResultU16, ResultU16Info};
use satrs_mib::resultcode;
#[derive(Debug)]
pub enum GroupId {

View File

@ -1,6 +1,6 @@
use satrs_core::res_code::ResultU16;
use satrs_mib::resultcode;
use satrs_mib::res_code::ResultU16Info;
use satrs_mib::resultcode;
#[resultcode(info = "This is a test result where the first parameter is foo")]
const TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1);

View File

@ -57,9 +57,9 @@ 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());
@ -68,27 +68,27 @@ pub mod stdmod {
}
wtr.flush()?;
Ok(())
}
}
pub fn write_resultcodes_to_csv(
pub fn write_resultcodes_to_csv(
results: &[ResultU16Info],
path: impl AsRef<Path>,
) -> Result<(), csv::Error> {
) -> 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;