willothy / worth

Found enum variants with similar prefixes or suffixes RS-C1003
Anti-pattern
Minor
a year agoa year old
Variant name suffixed with the enum's name
 28    ParseError(ParseError),
 29    #[error("[Preprocessor Error] {0}")]
 30    PreprocessorError(PreprocessorError),
 31    #[error("[Runtime Error] {0}")] 32    RuntimeError(RuntimeError), 33    #[error("[Runner Error] {0}")]
 34    RunnerError(RunnerError),
 35    #[error("[Typecheck Error] {0}")]
Variant name suffixed with the enum's name
 24pub enum Error {
 25    #[error("[Compile Error] {0}")]
 26    CompileError(CompileError),
 27    #[error("[Parse Error] {0}")] 28    ParseError(ParseError), 29    #[error("[Preprocessor Error] {0}")]
 30    PreprocessorError(PreprocessorError),
 31    #[error("[Runtime Error] {0}")]
Variant name suffixed with the enum's name
 82pub enum CompileError {
 83    #[error("Nasm failed t: {0}")]
 84    NasmInvokeError(std::io::Error),
 85    #[error("Nasm compile error")] 86    NasmCompileError, 87    #[error("Nasm invoke error: {0}")]
 88    LdInvokeError(std::io::Error),
 89    #[error("Ld linker error")]
Variant name suffixed with the enum's name
 34    RunnerError(RunnerError),
 35    #[error("[Typecheck Error] {0}")]
 36    TypecheckError(TypecheckError),
 37    #[error("[IO Error] {0}")] 38    IOError(IOError), 39}
 40
 41#[derive(Error, Debug)]
Variant name suffixed with the enum's name
 32    RuntimeError(RuntimeError),
 33    #[error("[Runner Error] {0}")]
 34    RunnerError(RunnerError),
 35    #[error("[Typecheck Error] {0}")] 36    TypecheckError(TypecheckError), 37    #[error("[IO Error] {0}")]
 38    IOError(IOError),
 39}