pub(crate) fn contract_type_and_mode(
        ident: &str,
    ) -> Option<(ContractType, ContractMode)> {
        match ident {
            "requires" => Some((ContractType::Requires, ContractMode::Always)),
            "ensures" => Some((ContractType::Ensures, ContractMode::Always)),
            "invariant" => {
                Some((ContractType::Invariant, ContractMode::Always))
            }
            "debug_requires" => {
                Some((ContractType::Requires, ContractMode::Debug))
            }
            "debug_ensures" => {
                Some((ContractType::Ensures, ContractMode::Debug))
            }
            "debug_invariant" => {
                Some((ContractType::Invariant, ContractMode::Debug))
            }
            "test_requires" => {
                Some((ContractType::Requires, ContractMode::Test))
            }
            "test_ensures" => Some((ContractType::Ensures, ContractMode::Test)),
            "test_invariant" => {
                Some((ContractType::Invariant, ContractMode::Test))
            }
            _ => None,
        }
    }
/// Determine the type and mode of an identifier.
Determine the type and mode of an identifier.
Determine the type and mode of an identifier .
pub(crate) fn contract_type_and_mode(
        ident: &str,
    ) -> Option<(ContractType, ContractMode)> {
        match ident {
            "requires" => Some((ContractType::Requires, ContractMode::Always)),
            "ensures" => Some((ContractType::Ensures, ContractMode::Always)),
            "invariant" => {
                Some((ContractType::Invariant, ContractMode::Always))
            }
            "debug_requires" => {
                Some((ContractType::Requires, ContractMode::Debug))
            }
            "debug_ensures" => {
                Some((ContractType::Ensures, ContractMode::Debug))
            }
            "debug_invariant" => {
                Some((ContractType::Invariant, ContractMode::Debug))
            }
            "test_requires" => {
                Some((ContractType::Requires, ContractMode::Test))
            }
            "test_ensures" => Some((ContractType::Ensures, ContractMode::Test)),
            "test_invariant" => {
                Some((ContractType::Invariant, ContractMode::Test))
            }
            _ => None,
        }
    }
pub ( crate ) fn contract_type_and_mode ( ident : & str , ) -> Option < ( ContractType , ContractMode ) > { match ident { " " => Some ( ( ContractType :: Requires , ContractMode :: Always ) ) , " " => Some ( ( ContractType :: Ensures , ContractMode :: Always ) ) , " " => { Some ( ( ContractType :: Invariant , ContractMode :: Always ) ) } " " => { Some ( ( ContractType :: Requires , ContractMode :: Debug ) ) } " " => { Some ( ( ContractType :: Ensures , ContractMode :: Debug ) ) } " " => { Some ( ( ContractType :: Invariant , ContractMode :: Debug ) ) } " " => { Some ( ( ContractType :: Requires , ContractMode :: Test ) ) } " " => Some ( ( ContractType :: Ensures , ContractMode :: Test ) ) , " " => { Some ( ( ContractType :: Invariant , ContractMode :: Test ) ) } _ => None , } }
Determine the type and mode of an identifier.
Determine the type and mode of an identifier .
ident
&str
ident
&str