mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-29 08:27:06 +00:00
fix(policy): remove six dead error variants (#6631)
Backlog#1845 step 8 prerequisite. policy::error::Error carried six variants with zero construction and zero match sites anywhere in the workspace: ErrCredMalformed, CredNotInitialized, NoAccessKey, InvalidToken, InvalidAccessKey, InvalidExpiration. Their only reference was the grouped fallthrough arm in iam's From<policy::error::Error>, whose own dead same-name twins were already removed in backlog#1831 (#6030). Delete the variants and their display-message test rows; the iam mapping's grouped arm shrinks from eight variants to the two that are actually produced (InvalidServiceType from service_type parsing, JWTError via #[from]). This clears the way for folding the remaining 25-arm hand-written mapping (backlog#1845 step 8). Ref rustfs/backlog#1845
This commit is contained in:
@@ -214,15 +214,11 @@ impl From<rustfs_policy::error::Error> for Error {
|
||||
rustfs_policy::error::Error::IamSysAlreadyInitialized => Error::IamSysAlreadyInitialized,
|
||||
// These policy variants had dead same-name twins on iam::Error (zero
|
||||
// construction and zero match sites, removed in backlog#1831); the
|
||||
// message is preserved through StringError instead.
|
||||
err @ (rustfs_policy::error::Error::InvalidServiceType(_)
|
||||
| rustfs_policy::error::Error::InvalidExpiration
|
||||
| rustfs_policy::error::Error::NoAccessKey
|
||||
| rustfs_policy::error::Error::InvalidToken
|
||||
| rustfs_policy::error::Error::InvalidAccessKey
|
||||
| rustfs_policy::error::Error::JWTError(_)
|
||||
| rustfs_policy::error::Error::CredNotInitialized
|
||||
| rustfs_policy::error::Error::ErrCredMalformed) => Error::StringError(err.to_string()),
|
||||
// message is preserved through StringError instead. Their six dead
|
||||
// siblings on policy::Error were deleted outright (backlog#1845).
|
||||
err @ (rustfs_policy::error::Error::InvalidServiceType(_) | rustfs_policy::error::Error::JWTError(_)) => {
|
||||
Error::StringError(err.to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user