Skip to content

Commit

Permalink
chore: Make rust clippy happy (apache#701)
Browse files Browse the repository at this point in the history
* chore: Make rust clippy happy

Signed-off-by: Xuanwo <[email protected]>

* Format code

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Jul 21, 2024
1 parent 01e21a9 commit 01362b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,7 @@ mod tests {
"2020-01-01T",
] {
for eval_mode in &[EvalMode::Legacy, EvalMode::Ansi, EvalMode::Try] {
assert_eq!(date_parser(*date, *eval_mode).unwrap(), Some(18262));
assert_eq!(date_parser(date, *eval_mode).unwrap(), Some(18262));
}
}

Expand All @@ -1875,14 +1875,14 @@ mod tests {
"--262143-12-31 ",
] {
for eval_mode in &[EvalMode::Legacy, EvalMode::Try] {
assert_eq!(date_parser(*date, *eval_mode).unwrap(), None);
assert_eq!(date_parser(date, *eval_mode).unwrap(), None);
}
assert!(date_parser(*date, EvalMode::Ansi).is_err());
assert!(date_parser(date, EvalMode::Ansi).is_err());
}

for date in &["-3638-5"] {
for eval_mode in &[EvalMode::Legacy, EvalMode::Try, EvalMode::Ansi] {
assert_eq!(date_parser(*date, *eval_mode).unwrap(), Some(-2048160));
assert_eq!(date_parser(date, *eval_mode).unwrap(), Some(-2048160));
}
}

Expand All @@ -1898,7 +1898,7 @@ mod tests {
"-0973250",
] {
for eval_mode in &[EvalMode::Legacy, EvalMode::Try, EvalMode::Ansi] {
assert_eq!(date_parser(*date, *eval_mode).unwrap(), None);
assert_eq!(date_parser(date, *eval_mode).unwrap(), None);
}
}
}
Expand Down
28 changes: 14 additions & 14 deletions src/kernels/temporal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ mod tests {
assert!(array.values().get(i) >= a.values().get(i))
}
}
_ => assert!(false),
_ => unreachable!(),
}
}
}
Expand All @@ -854,9 +854,9 @@ mod tests {
let mut vec: Vec<i32> = Vec::with_capacity(size * formats.len());
let mut fmt_vec: Vec<&str> = Vec::with_capacity(size * formats.len());
for i in 0..size {
for j in 0..formats.len() {
for fmt_value in &formats {
vec.push(i as i32 * 1_000_001);
fmt_vec.push(formats[j]);
fmt_vec.push(fmt_value);
}
}

Expand Down Expand Up @@ -928,7 +928,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
if let Ok(a) = date_trunc_array_fmt_dyn(&array_dict, &fmt_array) {
for i in 0..array.len() {
Expand All @@ -937,7 +937,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
if let Ok(a) = date_trunc_array_fmt_dyn(&array, &fmt_dict) {
for i in 0..array.len() {
Expand All @@ -946,7 +946,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
if let Ok(a) = date_trunc_array_fmt_dyn(&array_dict, &fmt_dict) {
for i in 0..array.len() {
Expand All @@ -955,7 +955,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
}

Expand Down Expand Up @@ -991,7 +991,7 @@ mod tests {
assert!(array.values().get(i) >= a.values().get(i))
}
}
_ => assert!(false),
_ => unreachable!(),
}
}
}
Expand Down Expand Up @@ -1023,9 +1023,9 @@ mod tests {
let mut vec: Vec<i64> = Vec::with_capacity(size * formats.len());
let mut fmt_vec: Vec<&str> = Vec::with_capacity(size * formats.len());
for i in 0..size {
for j in 0..formats.len() {
for fmt_value in &formats {
vec.push(i as i64 * 1_000_000_001);
fmt_vec.push(formats[j]);
fmt_vec.push(fmt_value);
}
}

Expand Down Expand Up @@ -1103,7 +1103,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
if let Ok(a) = timestamp_trunc_array_fmt_dyn(&array_dict, &fmt_array) {
for i in 0..array.len() {
Expand All @@ -1116,7 +1116,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
if let Ok(a) = timestamp_trunc_array_fmt_dyn(&array, &fmt_dict) {
for i in 0..array.len() {
Expand All @@ -1129,7 +1129,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
if let Ok(a) = timestamp_trunc_array_fmt_dyn(&array_dict, &fmt_dict) {
for i in 0..array.len() {
Expand All @@ -1142,7 +1142,7 @@ mod tests {
)
}
} else {
assert!(false)
unreachable!()
}
}
}

0 comments on commit 01362b5

Please sign in to comment.