Removing bincode from xml

This commit is contained in:
Able 2023-04-06 16:28:23 -05:00
parent 08fb866805
commit 89bbf03bd1
3 changed files with 9 additions and 19 deletions

10
Cargo.lock generated
View file

@ -75,15 +75,6 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1"
[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@ -507,7 +498,6 @@ dependencies = [
name = "xml" name = "xml"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bincode",
"serde", "serde",
] ]

View file

@ -10,4 +10,4 @@ serde = { version = "1.0", default-features = false, features = [
"derive", "derive",
"alloc", "alloc",
] } ] }
bincode = { version = "1.3.3", default-features = false, features = ["alloc"] } # bincode = { version = "1.3.3", default-features = false, features = ["alloc"] }

View file

@ -33,12 +33,12 @@ pub struct XMLElement {
} }
impl XMLElement { impl XMLElement {
pub fn to_bin(&self) -> Result<Vec<u8>, XMLError> { // pub fn to_bin(&self) -> Result<Vec<u8>, XMLError> {
match bincode::serialize(&self) { // // match bincode::serialize(&self) {
Ok(bin) => return Ok(bin), // // Ok(bin) => return Ok(bin),
Err(err) => return Err(XMLError::EncodingError(err)), // // Err(err) => return Err(XMLError::EncodingError(err)),
} // // }
} // }
pub fn from_bin(bin: Vec<u8>) -> Self { pub fn from_bin(bin: Vec<u8>) -> Self {
todo!() todo!()
} }
@ -284,6 +284,6 @@ pub fn string_to_num<T: Debug + Display>(string: T) -> Result<Types, XMLError> {
#[derive(Debug)] #[derive(Debug)]
pub enum XMLError { pub enum XMLError {
TypeNotANumber, TypeNotANumber,
EncodingError(bincode::Error), // EncodingError(bincode::Error),
DecodingError(bincode::Error), // DecodingError(bincode::Error),
} }