diff --git a/src/bc/de.rs b/src/bc/de.rs
index 33bdc48..24ba5d0 100644
--- a/src/bc/de.rs
+++ b/src/bc/de.rs
@@ -3,7 +3,7 @@ use nom::IResult;
use nom::{bytes::streaming::take, number::streaming::*, combinator::*, sequence::*};
use std::io::Read;
use super::model::*;
-use super::xml::Body;
+use super::xml::BcXml;
use super::xml_crypto;
#[derive(Debug, Error)]
@@ -132,7 +132,7 @@ fn bc_modern_msg<'a, 'b>(header: &'a BcHeader, buf: &'b [u8])
// thing is the same idiom Nom uses internally.
use nom::{Err, error::{make_error, ErrorKind}};
let xml = if end_of_xml > 0 {
- let parsed = Body::try_parse(processed_body_buf)
+ let parsed = BcXml::try_parse(processed_body_buf)
.map_err(|_| Err::Error(make_error(buf, ErrorKind::MapRes)))?;
Some(parsed)
} else { None };
diff --git a/src/bc/model.rs b/src/bc/model.rs
index b579893..bbe2708 100644
--- a/src/bc/model.rs
+++ b/src/bc/model.rs
@@ -1,4 +1,4 @@
-use super::xml::Body;
+use super::xml::BcXml;
pub(super) const MAGIC_HEADER: u32 = 0xabcdef0;
@@ -21,7 +21,7 @@ pub enum BcBody {
#[derive(Debug, Default, PartialEq, Eq)]
pub struct ModernMsg {
- pub xml: Option
,
+ pub xml: Option,
pub binary: Option>,
}
diff --git a/src/bc/ser.rs b/src/bc/ser.rs
index 21a6549..2c1bc62 100644
--- a/src/bc/ser.rs
+++ b/src/bc/ser.rs
@@ -4,7 +4,7 @@ use cookie_factory::sequence::tuple;
use cookie_factory::{GenError, SerializeFn, WriteContext};
use std::io::Write;
use super::model::*;
-use super::xml::Body;
+use super::xml::BcXml;
use super::xml_crypto;
pub type Error = GenError;
@@ -50,7 +50,7 @@ impl Bc {
}
}
-fn bc_xml(enc_offset: u32, xml: &Body) -> impl SerializeFn
+fn bc_xml(enc_offset: u32, xml: &BcXml) -> impl SerializeFn
{
let xml_bytes = xml.serialize(vec!()).unwrap();
let enc_bytes = xml_crypto::crypt(enc_offset, &xml_bytes);
diff --git a/src/bc/xml.rs b/src/bc/xml.rs
index 15b8fbf..051d4fb 100644
--- a/src/bc/xml.rs
+++ b/src/bc/xml.rs
@@ -14,7 +14,7 @@ use indoc::indoc;
#[derive(PartialEq, Eq, Default, Debug, YaDeserialize, YaSerialize)]
#[yaserde(rename="body")]
-pub struct Body {
+pub struct BcXml {
#[yaserde(rename="Encryption")]
pub encryption: Option,
#[yaserde(rename="LoginUser")]
@@ -25,7 +25,7 @@ pub struct Body {
pub device_info: Option,
}
-impl Body {
+impl BcXml {
pub fn try_parse(s: impl Read) -> Result {
yaserde::de::from_reader(s)
}
@@ -102,7 +102,7 @@ fn test_encryption_deser() {
9E6D1FCB9E69846D
"#);
- let b: Body = yaserde::de::from_str(sample).unwrap();
+ let b: BcXml = yaserde::de::from_str(sample).unwrap();
let enc = b.encryption.unwrap();
assert_eq!(enc.version, "1.1");
@@ -125,7 +125,7 @@ fn test_login_deser() {
0