added setup strict mode
This commit is contained in:
@ -38,7 +38,7 @@ pub struct Database {
|
||||
}
|
||||
|
||||
impl Database {
|
||||
pub fn new(val: &serde_json::Value) -> Result<Self, crate::drop::Drop> {
|
||||
pub fn new(val: &serde_json::Value) -> (Self, crate::drop::Drop) {
|
||||
let mut db = Self {
|
||||
enums: HashMap::new(),
|
||||
types: HashMap::new(),
|
||||
@ -151,10 +151,12 @@ impl Database {
|
||||
}
|
||||
|
||||
db.compile(&mut errors);
|
||||
if !errors.is_empty() {
|
||||
return Err(crate::drop::Drop::with_errors(errors));
|
||||
}
|
||||
Ok(db)
|
||||
let drop = if errors.is_empty() {
|
||||
crate::drop::Drop::success()
|
||||
} else {
|
||||
crate::drop::Drop::with_errors(errors)
|
||||
};
|
||||
(db, drop)
|
||||
}
|
||||
|
||||
/// Override the default executor for unit testing
|
||||
|
||||
Reference in New Issue
Block a user