mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-24 22:34:42 +01:00
Correct warnings for the slice length condition
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
if secret.len() <= 0 {
|
||||
if secret.len() == 0 {
|
||||
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()));
|
||||
}
|
||||
|
||||
if secret.len() <= 0 {
|
||||
if secret.len() == 0 {
|
||||
return Err("secret hasn't be empty, but the given value is empty".to_owned());
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ impl Server {
|
||||
return;
|
||||
}
|
||||
};
|
||||
if secret.len() <= 0 {
|
||||
if secret.len() == 0 {
|
||||
error!("empty secret returned from secret source; empty secret is prohibited");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user