-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I'm not an expert in the Rust module system so I can't really articulate the exact problem but especially now, with most types having their own error type, I wonder if the use / pub use / mod / pub mod structure can be made more elegant.
For example here in hdt.rs:
use crate::containers::rdf::Triple;
use crate::containers::{ControlInfo, control_info};
use crate::four_sect_dict::{DictError, DictReadError, IdKind};
use crate::triples::{ObjectIter, PredicateIter, PredicateObjectIter, SubjectIter, TripleId, TriplesBitmap};
use crate::vocab::*;
use crate::{FourSectDict, containers};
use crate::{header, header::Header};containers/mod.rs:
/// In-memory RDF representation.
pub mod rdf;
/// Variable length numbers.
pub mod vbyte;
// byte containers
mod adj_list;
pub mod bitmap;
pub mod sequence;
// control info section reader
pub mod control_info;
pub use adj_list::AdjList;
pub use bitmap::Bitmap;
pub use control_info::{ControlInfo, ControlType};
pub use sequence::Sequence;Can we improve this or is it fine as it is? Should we re-export the containers in lib.rs so that one can for example just use hdt::sequence::Error instead of hdt::containers::sequence::Error?