Does seem like a prelude module is frowned upon and people prefer explicit use-statements.
Most of the time a local Error type will be declared (and some other types with commonly used names) which would collide with the Error type from the prelude module. It would also lock the prelude module from actually having any additions or changes in any way, since an addition could cause a name-collision with a glob-use.
Example something I expect would be common:
// my_parser.rs
use chomp::parse_only;
use chomp::ascii::decimal;
use chomp::types::{Buffer, Input, ParseResult};
use chomp::parsers::Error as ChompError;
use chomp::parsers::{
any,
scan,
token,
take,
take_till,
};
use chomp::combinators::{
option,
sep_by1,
};
pub enum Error {
ChompError(ChompError<u8>),
ExpectedKeyword,
// ...
}
Does seem like a prelude module is frowned upon and people prefer explicit
use
-statements.Most of the time a local
Error
type will be declared (and some other types with commonly used names) which would collide with theError
type from the prelude module. It would also lock the prelude module from actually having any additions or changes in any way, since an addition could cause a name-collision with a glob-use
.Example something I expect would be common: