compare str == str instead of str bytes == bytes
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
shimun 2020-06-22 02:30:35 +02:00
parent eed2dad08f
commit 36dc36d454
Signed by: shimun
GPG Key ID: E81D8382DC2F971B

View File

@ -671,13 +671,7 @@ pub fn run_cli() -> Fido2LuksResult<()> {
token.credential = token
.credential
.into_iter()
.filter(|cred| {
!credentials
.ids
.0
.iter()
.any(|h| &h.0[..] == cred.as_bytes())
})
.filter(|cred| !credentials.ids.0.iter().any(|h| &h.to_string() == cred))
.collect();
dev.update_token(id, &token)?;
}
@ -690,7 +684,7 @@ pub fn run_cli() -> Fido2LuksResult<()> {
let mut remove = Vec::new();
for token in dev.tokens()? {
let (id, token) = token?;
if token.keyslots.is_empty() {
if token.keyslots.is_empty() || token.credential.is_empty() {
creds.extend(token.credential);
remove.push(id);
}