Facts are stored as a HashMap internally, so their order is not defined.
The Display impl for Authorizer does sort everything, so it has a stable output. It also adds more information in comments (namely the facts and rules origins, which is extremely important).
I guess we could just call .to_string() in dump_code() to keep backwards compatibility. However, the Display implementation for Authorizer only uses facts and rules from the Datalog::World value, so it may discard facts and rules added to the authorizer before calling authorize. I guess that overlaps with #192
Facts are stored as a
HashMap
internally, so their order is not defined.The
Display
impl forAuthorizer
does sort everything, so it has a stable output. It also adds more information in comments (namely the facts and rules origins, which is extremely important).I guess we could just call
.to_string()
indump_code()
to keep backwards compatibility. However, theDisplay
implementation forAuthorizer
only uses facts and rules from theDatalog::World
value, so it may discard facts and rules added to the authorizer before callingauthorize
. I guess that overlaps with #192