pub struct ProseQuantity {
pub line: usize,
pub quantity: String,
pub code: bool,
}Expand description
A quantity prose_quantities found: the 1-based line the quantity starts on, the
quantity as written, and whether it stands in a fenced code block. A quantity in a code
block is still a finding — a pasted benchmark output is a number about tokens a person
typed into the document — and the flag lets the finding say where it is.
use majordomus_cli::economics::claims::{prose_quantities, ProseQuantity};
let found = prose_quantities("README.md", "```\ntokens: 40% fewer\n```\n");
assert_eq!(found, vec![ProseQuantity { line: 2, quantity: "40%".into(), code: true }]);Fields§
§line: usize1-based line the quantity starts on.
quantity: StringThe quantity, as the finding names it (40%, 3x, half).
code: boolIn a fenced code block.
Trait Implementations§
Source§impl Clone for ProseQuantity
impl Clone for ProseQuantity
Source§fn clone(&self) -> ProseQuantity
fn clone(&self) -> ProseQuantity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProseQuantity
impl Debug for ProseQuantity
impl Eq for ProseQuantity
Source§impl PartialEq for ProseQuantity
impl PartialEq for ProseQuantity
Source§fn eq(&self, other: &ProseQuantity) -> bool
fn eq(&self, other: &ProseQuantity) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProseQuantity
Auto Trait Implementations§
impl Freeze for ProseQuantity
impl RefUnwindSafe for ProseQuantity
impl Send for ProseQuantity
impl Sync for ProseQuantity
impl Unpin for ProseQuantity
impl UnsafeUnpin for ProseQuantity
impl UnwindSafe for ProseQuantity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.