Skip to content

Commit

Permalink
Assume has_int_exp_fmt; drop autocfg
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Feb 8, 2024
1 parent 200f50f commit fdf7a41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 29 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,3 @@ std = ["num-bigint?/std", "num-integer/std", "num-traits/std"]
num-bigint-std = ["num-bigint/std"]
num-bigint = ["dep:num-bigint"]
serde = ["dep:serde"]

[build-dependencies]
autocfg = "1.0.0"
8 changes: 0 additions & 8 deletions build.rs

This file was deleted.

33 changes: 15 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2111,24 +2111,21 @@ mod test {
assert_fmt_eq!(format_args!("{:X}", -half_i8), "FF/2");
assert_fmt_eq!(format_args!("{:#X}", -half_i8), "0xFF/0x2");

#[cfg(has_int_exp_fmt)]
{
assert_fmt_eq!(format_args!("{:e}", -_2), "-2e0");
assert_fmt_eq!(format_args!("{:#e}", -_2), "-2e0");
assert_fmt_eq!(format_args!("{:+e}", -_2), "-2e0");
assert_fmt_eq!(format_args!("{:e}", _BILLION), "1e9");
assert_fmt_eq!(format_args!("{:+e}", _BILLION), "+1e9");
assert_fmt_eq!(format_args!("{:e}", _BILLION.recip()), "1e0/1e9");
assert_fmt_eq!(format_args!("{:+e}", _BILLION.recip()), "+1e0/1e9");

assert_fmt_eq!(format_args!("{:E}", -_2), "-2E0");
assert_fmt_eq!(format_args!("{:#E}", -_2), "-2E0");
assert_fmt_eq!(format_args!("{:+E}", -_2), "-2E0");
assert_fmt_eq!(format_args!("{:E}", _BILLION), "1E9");
assert_fmt_eq!(format_args!("{:+E}", _BILLION), "+1E9");
assert_fmt_eq!(format_args!("{:E}", _BILLION.recip()), "1E0/1E9");
assert_fmt_eq!(format_args!("{:+E}", _BILLION.recip()), "+1E0/1E9");
}
assert_fmt_eq!(format_args!("{:e}", -_2), "-2e0");
assert_fmt_eq!(format_args!("{:#e}", -_2), "-2e0");
assert_fmt_eq!(format_args!("{:+e}", -_2), "-2e0");
assert_fmt_eq!(format_args!("{:e}", _BILLION), "1e9");
assert_fmt_eq!(format_args!("{:+e}", _BILLION), "+1e9");
assert_fmt_eq!(format_args!("{:e}", _BILLION.recip()), "1e0/1e9");
assert_fmt_eq!(format_args!("{:+e}", _BILLION.recip()), "+1e0/1e9");

assert_fmt_eq!(format_args!("{:E}", -_2), "-2E0");
assert_fmt_eq!(format_args!("{:#E}", -_2), "-2E0");
assert_fmt_eq!(format_args!("{:+E}", -_2), "-2E0");
assert_fmt_eq!(format_args!("{:E}", _BILLION), "1E9");
assert_fmt_eq!(format_args!("{:+E}", _BILLION), "+1E9");
assert_fmt_eq!(format_args!("{:E}", _BILLION.recip()), "1E0/1E9");
assert_fmt_eq!(format_args!("{:+E}", _BILLION.recip()), "+1E0/1E9");
}

mod arith {
Expand Down

0 comments on commit fdf7a41

Please sign in to comment.