• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facet-rs / facet / 15144727940

20 May 2025 06:08PM UTC coverage: 57.475% (+0.06%) from 57.413%
15144727940

Pull #653

github

web-flow
Merge 1beac3156 into 165766df4
Pull Request #653: refactor(args): `ArgType` enum, various field helpers

211 of 249 new or added lines in 5 files covered. (84.74%)

15 existing lines in 1 file now uncovered.

9411 of 16374 relevant lines covered (57.48%)

136.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/facet-args/src/parse.rs
1
use alloc::borrow::Cow;
2
use facet_deserialize::{Outcome, Raw, Scalar, Span, Spanned};
3

4
pub(crate) fn parse_scalar<'a>(arg: &'a str, span: Span<Raw>) -> Spanned<Outcome<'a>, Raw> {
29✔
5
    // Try to parse numbers in order of specificity
6
    if let Ok(v) = arg.parse::<u64>() {
29✔
7
        return Spanned {
13✔
8
            node: Outcome::Scalar(Scalar::U64(v)),
13✔
9
            span,
13✔
10
        };
13✔
11
    }
16✔
12
    if let Ok(v) = arg.parse::<i64>() {
16✔
NEW
13
        return Spanned {
×
NEW
14
            node: Outcome::Scalar(Scalar::I64(v)),
×
NEW
15
            span,
×
NEW
16
        };
×
17
    }
16✔
18
    if let Ok(v) = arg.parse::<f64>() {
16✔
19
        return Spanned {
1✔
20
            node: Outcome::Scalar(Scalar::F64(v)),
1✔
21
            span,
1✔
22
        };
1✔
23
    }
15✔
24

25
    // Default to string
26
    Spanned {
15✔
27
        node: Outcome::Scalar(Scalar::String(Cow::Borrowed(arg))),
15✔
28
        span,
15✔
29
    }
15✔
30
}
29✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc