Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy cleanup #215

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions utf64/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ mod test {

let valid_utf64 = v["valid_utf64"].take();
let valid_utf64 = valid_utf64.as_object().unwrap();
assert!(valid_utf64.len() > 0);
assert!(!valid_utf64.is_empty());

let mut success = 0;
let mut failure = 0;
for (k, v) in valid_utf64 {
let enc = v.as_str().unwrap().encode_utf64().unwrap();
if k == &enc.as_str() {
if k == enc.as_str() {
success += 1;
} else {
failure += 1;
Expand All @@ -186,7 +186,7 @@ mod test {
for (k, v) in valid_utf64 {
match k.decode_utf64() {
Ok(dec) => {
if v == &dec.as_str() {
if v == dec.as_str() {
success += 1;
} else {
failure += 1;
Expand All @@ -212,11 +212,11 @@ mod test {

let invalid_utf64 = v["invalid_utf64"].take();
let invalid_utf64 = invalid_utf64.as_object().unwrap();
assert!(invalid_utf64.len() > 0);
assert!(!invalid_utf64.is_empty());

let mut failure = 0;
for (k, _) in invalid_utf64 {
if !k.decode_utf64().is_err() {
if k.decode_utf64().is_ok() {
failure += 1;
println!("failed to report '{k}' as invalid utf64");
}
Expand Down
Loading