-
Notifications
You must be signed in to change notification settings - Fork 37
Move the Ion value types to the types module #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ use crate::binary::uint::DecodedUInt; | |
use crate::binary::var_uint::VarUInt; | ||
use crate::raw_symbol_token_ref::{AsRawSymbolTokenRef, RawSymbolTokenRef}; | ||
use crate::result::{illegal_operation, IonResult}; | ||
use crate::types::decimal::Decimal; | ||
use crate::types::timestamp::Timestamp; | ||
use crate::types::Decimal; | ||
use crate::types::Timestamp; | ||
use crate::types::{ContainerType, SymbolId}; | ||
Comment on lines
+14
to
16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would consolidate these. |
||
use crate::writer::IonWriter; | ||
use crate::{Int, IonType}; | ||
|
@@ -910,10 +910,10 @@ mod writer_tests { | |
use rstest::*; | ||
|
||
use super::*; | ||
use crate::element::{Blob, Clob}; | ||
use crate::raw_symbol_token::{local_sid_token, RawSymbolToken}; | ||
use crate::reader::{Reader, ReaderBuilder}; | ||
use crate::symbol::Symbol; | ||
use crate::types::Symbol; | ||
use crate::types::{Blob, Clob}; | ||
Comment on lines
+915
to
+916
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would consolidate these. |
||
use crate::IonReader; | ||
use num_bigint::BigInt; | ||
use num_traits::Float; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,26 +25,20 @@ use std::fmt::{Display, Formatter}; | |
|
||
mod annotations; | ||
pub mod builders; | ||
mod bytes; | ||
mod element_stream_reader; | ||
mod iterators; | ||
mod list; | ||
mod lob; | ||
pub(crate) mod iterators; | ||
pub mod reader; | ||
mod sequence; | ||
mod sexp; | ||
mod r#struct; | ||
pub mod writer; | ||
|
||
// Re-export the Value variant types and traits so they can be accessed directly from this module. | ||
pub use self::bytes::Bytes; | ||
pub use crate::types::Bytes; | ||
pub use crate::types::{Blob, Clob}; | ||
pub use annotations::{Annotations, IntoAnnotations}; | ||
pub use lob::{Blob, Clob}; | ||
|
||
pub use list::List; | ||
pub use r#struct::Struct; | ||
pub use sequence::Sequence; | ||
pub use sexp::SExp; | ||
pub use crate::types::List; | ||
pub use crate::types::SExp; | ||
pub use crate::types::Sequence; | ||
pub use crate::types::Struct; | ||
Comment on lines
33
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I would at least put these together so they |
||
|
||
impl IonEq for Value { | ||
fn ion_eq(&self, other: &Self) -> bool { | ||
|
@@ -614,7 +608,7 @@ where | |
#[cfg(test)] | ||
mod tests { | ||
use crate::element::annotations::IntoAnnotations; | ||
use crate::types::timestamp::Timestamp; | ||
use crate::types::Timestamp; | ||
use crate::{ion_list, ion_sexp, ion_struct, Decimal, Int, IonType, Symbol}; | ||
use chrono::*; | ||
use rstest::*; | ||
|
@@ -864,7 +858,7 @@ mod tests { | |
} | ||
|
||
use crate::element::{Annotations, Element, IntoAnnotatedElement, Struct}; | ||
use crate::types::integer::IntAccess; | ||
use crate::types::IntAccess; | ||
use num_bigint::BigInt; | ||
use std::collections::HashSet; | ||
use std::str::FromStr; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,9 @@ use crate::binary::{self, decimal::DecimalBinaryEncoder, timestamp::TimestampBin | |
use crate::element::{Element, Sequence, Struct}; | ||
use crate::ion_hash::element_hasher::ElementHasher; | ||
use crate::ion_hash::type_qualifier::type_qualifier_symbol; | ||
use crate::types::decimal::Decimal; | ||
use crate::types::integer::Int; | ||
use crate::{result::IonResult, types::timestamp::Timestamp, IonType, Symbol}; | ||
use crate::types::Decimal; | ||
use crate::types::Int; | ||
use crate::{result::IonResult, types::Timestamp, IonType, Symbol}; | ||
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would move |
||
use digest::{FixedOutput, Output, Reset, Update}; | ||
|
||
pub(crate) trait RepresentationEncoder { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,15 @@ use crate::raw_reader::{RawReader, RawStreamItem}; | |
use crate::raw_symbol_token::RawSymbolToken; | ||
use crate::result::{decoding_error, decoding_error_raw, IonResult}; | ||
use crate::stream_reader::IonReader; | ||
use crate::symbol::Symbol; | ||
use crate::symbol_table::SymbolTable; | ||
use crate::types::decimal::Decimal; | ||
use crate::types::integer::Int; | ||
use crate::types::timestamp::Timestamp; | ||
use crate::types::Decimal; | ||
use crate::types::Int; | ||
use crate::types::Symbol; | ||
use crate::types::Timestamp; | ||
Comment on lines
+16
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I look through a bunch of these, how much should be be consistent with |
||
use crate::{BlockingRawBinaryReader, BlockingRawTextReader, IonType}; | ||
use std::fmt::{Display, Formatter}; | ||
|
||
use crate::types::string::Str; | ||
use crate::types::Str; | ||
/// Configures and constructs new instances of [Reader]. | ||
pub struct ReaderBuilder {} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consolidate these
crate::types::{...}
imports, especially the one that saystypes::Decimal
.