pub fn default_arg(&mut self, name: &str) -> Result<ValueValidator, DatamodelError> {
        match (self.args.remove(name), self.args.remove("")) {
            (Some(arg), None) => Ok(ValueValidator::new(&arg.value)),
            (None, Some(arg)) => Ok(ValueValidator::new(&arg.value)),
            (Some(arg), Some(_)) => Err(DatamodelError::new_duplicate_default_argument_error(&name, arg.span)),
            (None, None) => Err(DatamodelError::new_argument_not_found_error(name, self.span)),
        }
    }
/// Gets the arg with the given name, or if it is not found, the first unnamed argument.
///
/// Use this to implement unnamed argument behavior.
Gets the arg with the given name, or if it is not found, the first unnamed argument.
Use this to implement unnamed argument behavior.
Gets the arg with the given name or if it is not found the first unnamed argument . Use this to implement unnamed argument behavior .
pub fn default_arg(&mut self, name: &str) -> Result<ValueValidator, DatamodelError> {
        match (self.args.remove(name), self.args.remove("")) {
            (Some(arg), None) => Ok(ValueValidator::new(&arg.value)),
            (None, Some(arg)) => Ok(ValueValidator::new(&arg.value)),
            (Some(arg), Some(_)) => Err(DatamodelError::new_duplicate_default_argument_error(&name, arg.span)),
            (None, None) => Err(DatamodelError::new_argument_not_found_error(name, self.span)),
        }
    }
pub fn default_arg ( & mut self , name : & str ) -> Result < ValueValidator , DatamodelError > { match ( self . args . remove ( name ) , self . args . remove ( " " ) ) { ( Some ( arg ) , None ) => Ok ( ValueValidator :: new ( & arg . value ) ) , ( None , Some ( arg ) ) => Ok ( ValueValidator :: new ( & arg . value ) ) , ( Some ( arg ) , Some ( _ ) ) => Err ( DatamodelError :: new_duplicate_default_argument_error ( & name , arg . span ) ) , ( None , None ) => Err ( DatamodelError :: new_argument_not_found_error ( name , self . span ) ) , } }
Gets the arg with the given name, or if it is not found, the first unnamed argument.
Gets the arg with the given name or if it is not found the first unnamed argument .
&mut self
name
&str