Clean up error situation
This commit is contained in:
parent
1011818be6
commit
3f5e431717
|
@ -1,9 +1,9 @@
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write, Error};
|
||||||
use super::{
|
use super::{
|
||||||
decoder::{self, Decoder, DecodePlaceholderMap},
|
decoder::{self, Decoder, DecodePlaceholderMap},
|
||||||
encoder::{Encoder, EncodePlaceholderMap},
|
encoder::{Encoder, EncodePlaceholderMap},
|
||||||
invert_map,
|
invert_map,
|
||||||
reader::{BinaryReader, Error, is_eof_error},
|
reader::{BinaryReader, is_eof_error},
|
||||||
value::{
|
value::{
|
||||||
NestedValue, Domain,
|
NestedValue, Domain,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use super::reader::{Reader, is_eof_error};
|
use super::reader::{Reader, is_eof_error};
|
||||||
use super::value::{NestedValue, Domain};
|
use super::value::{NestedValue, Domain};
|
||||||
|
|
||||||
pub use super::reader::{Error, Result, DecodePlaceholderMap};
|
pub use super::reader::{Result, DecodePlaceholderMap};
|
||||||
|
|
||||||
pub struct Decoder<'a, R: Reader, N: NestedValue<Dom>, Dom: Domain> {
|
pub struct Decoder<'a, R: Reader, N: NestedValue<Dom>, Dom: Domain> {
|
||||||
pub read: R,
|
pub read: R,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use super::value::{Value, NestedValue, Float, Double, Map, Domain};
|
use super::value::{Value, NestedValue, Float, Double, Map, Domain};
|
||||||
use super::writer::Writer;
|
use super::writer::Writer;
|
||||||
|
|
||||||
pub use super::writer::{Error, Result};
|
pub use super::writer::Result;
|
||||||
|
|
||||||
pub type EncodePlaceholderMap<N, D> = Map<Value<N, D>, usize>;
|
pub type EncodePlaceholderMap<N, D> = Map<Value<N, D>, usize>;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ pub enum Error<D: Domain> {
|
||||||
NumberTooLarge(BigInt),
|
NumberTooLarge(BigInt),
|
||||||
CannotDeserializeAny,
|
CannotDeserializeAny,
|
||||||
Expected(ExpectedKind, PlainValue<D>),
|
Expected(ExpectedKind, PlainValue<D>),
|
||||||
InternalMagicError,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
use num::bigint::BigInt;
|
use num::bigint::BigInt;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::io::Read;
|
use std::io::{Read, Error};
|
||||||
use super::constants::{Op, InvalidOp, AtomMinor, CompoundMinor};
|
use super::constants::{Op, InvalidOp, AtomMinor, CompoundMinor};
|
||||||
use super::value::{Value, Domain, NestedValue, Map, Set};
|
use super::value::{Value, Domain, NestedValue, Map, Set};
|
||||||
|
|
||||||
pub type Error = std::io::Error;
|
|
||||||
pub type Result<T> = std::result::Result<T, Error>;
|
pub type Result<T> = std::result::Result<T, Error>;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use num::bigint::BigInt;
|
use num::bigint::BigInt;
|
||||||
use num::cast::ToPrimitive;
|
use num::cast::ToPrimitive;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
use std::io::Error;
|
||||||
use super::constants::{Op, AtomMinor, CompoundMinor};
|
use super::constants::{Op, AtomMinor, CompoundMinor};
|
||||||
|
|
||||||
pub type Error = std::io::Error;
|
|
||||||
pub type Result = std::result::Result<(), Error>;
|
pub type Result = std::result::Result<(), Error>;
|
||||||
|
|
||||||
pub trait Writer {
|
pub trait Writer {
|
||||||
|
|
Loading…
Reference in New Issue