run cargo fmt
This commit is contained in:
parent
fd59f25fea
commit
6a488f77db
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user