forked from AbleOS/ableos_userland
Removing bincode from xml
This commit is contained in:
parent
08fb866805
commit
89bbf03bd1
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -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",
|
||||
]
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue