please clippy
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Trinity Pointard 2021-12-14 19:34:01 +01:00
parent 6fef0f4cad
commit fd341177e9

View file

@ -134,16 +134,15 @@ pub struct Redirect {
impl WebsiteConfiguration {
pub fn validate(&self) -> Result<(), Error> {
if self.redirect_all_requests_to.is_some() {
if self.error_document.is_some()
if self.redirect_all_requests_to.is_some()
&& (self.error_document.is_some()
|| self.index_document.is_some()
|| self.routing_rules.is_some()
|| self.routing_rules.is_some())
{
return Err(Error::BadRequest(
"Bad XML: can't have RedirectAllRequestsTo and other fields".to_owned(),
));
}
}
if let Some(ref ed) = self.error_document {
ed.validate()?;
}