File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -643,6 +643,34 @@ pub enum DeclarationError {
643643 /// An invalid range was provided to a parameter declaration (i.e. lower bound > higher bound).
644644 InvalidRange ,
645645}
646+ impl Display for DeclarationError {
647+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
648+ match self {
649+ DeclarationError :: AlreadyDeclared => write ! (
650+ f,
651+ "Parameter was already declared and a new declaration was attempted"
652+ ) ,
653+ DeclarationError :: NoValueAvailable => write ! (
654+ f,
655+ "Parameter was declared as non optional but no value was available"
656+ ) ,
657+ DeclarationError :: OverrideValueTypeMismatch => {
658+ write ! ( f, "The override value that was provided has the wrong type" )
659+ }
660+ DeclarationError :: PriorValueTypeMismatch => write ! (
661+ f,
662+ "The value that the parameter was already set to has the wrong type"
663+ ) ,
664+ DeclarationError :: InitialValueOutOfRange => {
665+ write ! ( f, "The initial value that was selected is out of range" )
666+ }
667+ DeclarationError :: InvalidRange => write ! (
668+ f,
669+ "An invalid range was provided to a parameter declaration"
670+ ) ,
671+ }
672+ }
673+ }
646674
647675impl < ' a > Parameters < ' a > {
648676 /// Tries to read a parameter of the requested type.
You can’t perform that action at this time.
0 commit comments