#[non_exhaustive]pub enum FixError {
Syntax {
line: usize,
},
NeverRewritten {
line: usize,
},
MapCycle,
UnknownFamily {
name: String,
},
UnknownMap {
name: String,
},
FamilyCycle {
name: String,
},
UnrootedFamily {
name: String,
},
RootReparented,
TouchedAllowedBytes,
NotIdempotent,
}Expand description
Why a map cannot be used, or a fix cannot be trusted.
Every variant is a refusal to produce text, never a partial rewrite: a config error the caller turns into exit 2, or an invariant this node checked on itself before anything could be written.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Syntax
A map line that is not one of the declared forms, by 1-based number.
NeverRewritten
A map line whose source every set grants, so it can never be
rewritten (src/judge:V116).
MapCycle
A replacement is rewritten again without ever settling, so the map chains back to a source it already used.
UnknownFamily
A family was named that nothing declares.
UnknownMap
A use line named a map this crate does not ship (src/fix/words:V51).
FamilyCycle
A parent chain comes back to a family it already visited (V27).
UnrootedFamily
A family has no parent, so its chain never reaches ascii (V27).
RootReparented
ascii is the intrinsic root and cannot be given a parent (V27).
TouchedAllowedBytes
fix would have changed a byte outside a violation (V6).
NotIdempotent
fix(fix(x)) would differ from fix(x) (V5).
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()