Closed dlurton closed 1 year ago
It's currently not pub. This prevents ion_schema::violation::Violation from being referenced explicitly in customer code.
pub
ion_schema::violation::Violation
The impact is that the customer code cannot reference the type explicitly. For instance this code works fine:
let type_ref: TypeRef = ...; let r = type_ref.validate(some_element); let e = r.unwrap_err(); // e can be used normally
But try to declare an explicit type for e:
e
let e: ion_schema::violation::Violation = r.unwrap_err(); // ^ error, mod is private
use ion_schema::violation::Violation doesn't work either.
use ion_schema::violation::Violation
TBH, it's a bit surprising to me that Rust allows you to return a type from Type_Ref::validate() that isn't in a public module.
Type_Ref::validate()
Fixed with #139
It's currently not
pub
. This preventsion_schema::violation::Violation
from being referenced explicitly in customer code.The impact is that the customer code cannot reference the type explicitly. For instance this code works fine:
But try to declare an explicit type for
e
:use ion_schema::violation::Violation
doesn't work either.TBH, it's a bit surprising to me that Rust allows you to return a type from
Type_Ref::validate()
that isn't in a public module.