bump versions, apply clippy + fmt
This commit is contained in:
3 files changed
+12
-26
No files matched your search
+8
-22
@@ -2,9 +2,9 @@ use std::convert::TryFrom;
|
||||
use std::io::BufReader;
|
||||
|
||||
use crate::DsnRespParseError;
|
||||
use xml::EventReader;
|
||||
use xml::attribute::OwnedAttribute;
|
||||
use xml::reader::XmlEvent;
|
||||
use xml::EventReader;
|
||||
|
||||
fn get_attr(attrs: &[OwnedAttribute], name: &str) -> Result<String, DsnRespParseError> {
|
||||
attrs
|
||||
@@ -60,24 +60,15 @@ impl DsnResponse {
|
||||
if let Some(station) = station {
|
||||
stations.push(station);
|
||||
}
|
||||
station = Some(Station::try_from(attributes).unwrap());
|
||||
station = Some(Station::try_from(attributes)?);
|
||||
} else if name.local_name.contains("dish") {
|
||||
dish = Some(Dish::try_from(attributes).unwrap());
|
||||
dish = Some(Dish::try_from(attributes)?);
|
||||
} else if name.local_name.contains("downSignal") {
|
||||
dish = Some(
|
||||
dish.unwrap()
|
||||
.add_down_signal(Signal::try_from(attributes).unwrap()),
|
||||
);
|
||||
dish = Some(dish.unwrap().add_down_signal(Signal::try_from(attributes)?));
|
||||
} else if name.local_name.contains("upSignal") {
|
||||
dish = Some(
|
||||
dish.unwrap()
|
||||
.add_up_signal(Signal::try_from(attributes).unwrap()),
|
||||
);
|
||||
dish = Some(dish.unwrap().add_up_signal(Signal::try_from(attributes)?));
|
||||
} else if name.local_name.contains("target") {
|
||||
dish = Some(
|
||||
dish.unwrap()
|
||||
.add_target(Target::try_from(attributes).unwrap()),
|
||||
);
|
||||
dish = Some(dish.unwrap().add_target(Target::try_from(attributes)?));
|
||||
}
|
||||
}
|
||||
Ok(XmlEvent::EndElement { name }) => {
|
||||
@@ -138,10 +129,11 @@ impl TryFrom<Vec<OwnedAttribute>> for Station {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Default)]
|
||||
pub enum SignalType {
|
||||
Data,
|
||||
Carrier,
|
||||
#[default]
|
||||
None,
|
||||
Unkown(String),
|
||||
}
|
||||
@@ -157,12 +149,6 @@ impl From<String> for SignalType {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for SignalType {
|
||||
fn default() -> Self {
|
||||
SignalType::None
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Signal {
|
||||
pub signal_type: SignalType,
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
pub use crate::model::*;
|
||||
pub use crate::DsnRespParseError;
|
||||
pub use crate::model::*;
|
||||
Reference in new issue
Block a user