mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-30 15:58:44 +01:00
Correct warnings for the slice length condition
This commit is contained in:
+2
-2
@@ -33,7 +33,7 @@ impl Attribute {
|
|||||||
return Err("the length of plain_text has to be within 128, but the given value is longer".to_owned());
|
return Err("the length of plain_text has to be within 128, but the given value is longer".to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
if secret.len() <= 0 {
|
if secret.len() == 0 {
|
||||||
return Err("secret hasn't be empty, but the given value is empty".to_owned());
|
return Err("secret hasn't be empty, but the given value is empty".to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ impl Attribute {
|
|||||||
return Err(format!("invalid attribute length {}", self.0.len()));
|
return Err(format!("invalid attribute length {}", self.0.len()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if secret.len() <= 0 {
|
if secret.len() == 0 {
|
||||||
return Err("secret hasn't be empty, but the given value is empty".to_owned());
|
return Err("secret hasn't be empty, but the given value is empty".to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -103,7 +103,7 @@ impl Server {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if secret.len() <= 0 {
|
if secret.len() == 0 {
|
||||||
error!("empty secret returned from secret source; empty secret is prohibited");
|
error!("empty secret returned from secret source; empty secret is prohibited");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user