Removing bincode from xml

pull/1/head
Able 2023-04-06 16:28:23 -05:00
parent ce6421f212
commit 8fa6c705f2
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"
checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1"
[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]
[[package]]
name = "bitflags"
version = "1.3.2"
@ -507,7 +498,6 @@ dependencies = [
name = "xml"
version = "0.1.0"
dependencies = [
"bincode",
"serde",
]

View File

@ -10,4 +10,4 @@ serde = { version = "1.0", default-features = false, features = [
"derive",
"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 {
pub fn to_bin(&self) -> Result<Vec<u8>, XMLError> {
match bincode::serialize(&self) {
Ok(bin) => return Ok(bin),
Err(err) => return Err(XMLError::EncodingError(err)),
}
}
// pub fn to_bin(&self) -> Result<Vec<u8>, XMLError> {
// // match bincode::serialize(&self) {
// // Ok(bin) => return Ok(bin),
// // Err(err) => return Err(XMLError::EncodingError(err)),
// // }
// }
pub fn from_bin(bin: Vec<u8>) -> Self {
todo!()
}
@ -284,6 +284,6 @@ pub fn string_to_num<T: Debug + Display>(string: T) -> Result<Types, XMLError> {
#[derive(Debug)]
pub enum XMLError {
TypeNotANumber,
EncodingError(bincode::Error),
DecodingError(bincode::Error),
// EncodingError(bincode::Error),
// DecodingError(bincode::Error),
}