mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
uucore: Move extendedbigdecimal to its own feature
This will be needed later on so that we can split format and parse features.
This commit is contained in:
parent
97fb15b02d
commit
a937aa5117
10 changed files with 31 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
|||
# spell-checker:ignore bigdecimal cfgs
|
||||
# spell-checker:ignore bigdecimal cfgs extendedbigdecimal
|
||||
[package]
|
||||
name = "uu_seq"
|
||||
version = "0.0.30"
|
||||
|
@ -23,7 +23,11 @@ clap = { workspace = true }
|
|||
num-bigint = { workspace = true }
|
||||
num-traits = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
uucore = { workspace = true, features = ["format", "quoting-style"] }
|
||||
uucore = { workspace = true, features = [
|
||||
"extendedbigdecimal",
|
||||
"format",
|
||||
"quoting-style",
|
||||
] }
|
||||
|
||||
[[bin]]
|
||||
name = "seq"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// spell-checker:ignore extendedbigdecimal
|
||||
use num_traits::Zero;
|
||||
|
||||
use uucore::format::ExtendedBigDecimal;
|
||||
use uucore::extendedbigdecimal::ExtendedBigDecimal;
|
||||
|
||||
/// A number with a specified number of integer and fractional digits.
|
||||
///
|
||||
|
|
|
@ -12,7 +12,7 @@ use std::str::FromStr;
|
|||
use uucore::format::num_parser::{ExtendedParser, ExtendedParserError};
|
||||
|
||||
use crate::number::PreciseNumber;
|
||||
use uucore::format::ExtendedBigDecimal;
|
||||
use uucore::extendedbigdecimal::ExtendedBigDecimal;
|
||||
|
||||
/// An error returned when parsing a number fails.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
@ -126,7 +126,7 @@ impl FromStr for PreciseNumber {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bigdecimal::BigDecimal;
|
||||
use uucore::format::ExtendedBigDecimal;
|
||||
use uucore::extendedbigdecimal::ExtendedBigDecimal;
|
||||
|
||||
use crate::number::PreciseNumber;
|
||||
use crate::numberparse::ParseNumberError;
|
||||
|
|
|
@ -10,8 +10,9 @@ use clap::{Arg, ArgAction, Command};
|
|||
use num_traits::Zero;
|
||||
|
||||
use uucore::error::{FromIo, UResult};
|
||||
use uucore::extendedbigdecimal::ExtendedBigDecimal;
|
||||
use uucore::format::num_format::FloatVariant;
|
||||
use uucore::format::{ExtendedBigDecimal, Format, num_format};
|
||||
use uucore::format::{Format, num_format};
|
||||
use uucore::{format_usage, help_about, help_usage};
|
||||
|
||||
mod error;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# spell-checker:ignore (features) bigdecimal zerocopy
|
||||
# spell-checker:ignore (features) bigdecimal zerocopy extendedbigdecimal
|
||||
|
||||
[package]
|
||||
name = "uucore"
|
||||
|
@ -92,11 +92,18 @@ colors = []
|
|||
checksum = ["data-encoding", "thiserror", "sum"]
|
||||
encoding = ["data-encoding", "data-encoding-macro", "z85"]
|
||||
entries = ["libc"]
|
||||
extendedbigdecimal = ["bigdecimal", "num-traits"]
|
||||
fs = ["dunce", "libc", "winapi-util", "windows-sys"]
|
||||
fsext = ["libc", "windows-sys"]
|
||||
fsxattr = ["xattr"]
|
||||
lines = []
|
||||
format = ["bigdecimal", "itertools", "num-traits", "quoting-style"]
|
||||
format = [
|
||||
"bigdecimal",
|
||||
"extendedbigdecimal",
|
||||
"itertools",
|
||||
"num-traits",
|
||||
"quoting-style",
|
||||
]
|
||||
mode = ["libc"]
|
||||
perms = ["entries", "libc", "walkdir"]
|
||||
buf-copy = []
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
// features ~ feature-gated modules (core/bundler file)
|
||||
//
|
||||
// spell-checker:ignore (features) extendedbigdecimal
|
||||
|
||||
#[cfg(feature = "backup-control")]
|
||||
pub mod backup_control;
|
||||
|
@ -16,6 +18,8 @@ pub mod colors;
|
|||
pub mod custom_tz_fmt;
|
||||
#[cfg(feature = "encoding")]
|
||||
pub mod encoding;
|
||||
#[cfg(feature = "extendedbigdecimal")]
|
||||
pub mod extendedbigdecimal;
|
||||
#[cfg(feature = "format")]
|
||||
pub mod format;
|
||||
#[cfg(feature = "fs")]
|
||||
|
|
|
@ -235,7 +235,7 @@ mod tests {
|
|||
use bigdecimal::BigDecimal;
|
||||
use num_traits::Zero;
|
||||
|
||||
use crate::format::extendedbigdecimal::ExtendedBigDecimal;
|
||||
use crate::extendedbigdecimal::ExtendedBigDecimal;
|
||||
|
||||
#[test]
|
||||
fn test_addition_infinity() {
|
|
@ -33,14 +33,13 @@
|
|||
|
||||
mod argument;
|
||||
mod escape;
|
||||
pub mod extendedbigdecimal;
|
||||
pub mod human;
|
||||
pub mod num_format;
|
||||
pub mod num_parser;
|
||||
mod spec;
|
||||
|
||||
use crate::extendedbigdecimal::ExtendedBigDecimal;
|
||||
pub use argument::*;
|
||||
pub use extendedbigdecimal::ExtendedBigDecimal;
|
||||
pub use spec::Spec;
|
||||
use std::{
|
||||
error::Error,
|
||||
|
|
|
@ -15,7 +15,7 @@ use num_traits::Signed;
|
|||
use num_traits::ToPrimitive;
|
||||
use num_traits::Zero;
|
||||
|
||||
use crate::format::extendedbigdecimal::ExtendedBigDecimal;
|
||||
use crate::extendedbigdecimal::ExtendedBigDecimal;
|
||||
|
||||
/// Base for number parsing
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
|
@ -486,7 +486,7 @@ mod tests {
|
|||
|
||||
use bigdecimal::BigDecimal;
|
||||
|
||||
use crate::format::ExtendedBigDecimal;
|
||||
use crate::extendedbigdecimal::ExtendedBigDecimal;
|
||||
|
||||
use super::{ExtendedParser, ExtendedParserError};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! library ~ (core/bundler file)
|
||||
// #![deny(missing_docs)] //TODO: enable this
|
||||
//
|
||||
// spell-checker:ignore sigaction SIGBUS SIGSEGV
|
||||
// spell-checker:ignore sigaction SIGBUS SIGSEGV extendedbigdecimal
|
||||
|
||||
// * feature-gated external crates (re-shared as public internal modules)
|
||||
#[cfg(feature = "libc")]
|
||||
|
@ -50,6 +50,8 @@ pub use crate::features::colors;
|
|||
pub use crate::features::custom_tz_fmt;
|
||||
#[cfg(feature = "encoding")]
|
||||
pub use crate::features::encoding;
|
||||
#[cfg(feature = "extendedbigdecimal")]
|
||||
pub use crate::features::extendedbigdecimal;
|
||||
#[cfg(feature = "format")]
|
||||
pub use crate::features::format;
|
||||
#[cfg(feature = "fs")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue