This commit is contained in:
nora 2022-09-13 16:30:25 +02:00
parent 505a8f80d5
commit 166b495586
5 changed files with 19 additions and 15 deletions

3
.rustfmt.toml Normal file
View file

@ -0,0 +1,3 @@
imports_granularity = "Crate"
newline_style = "Unix"
group_imports = "StdExternalCrate"

View file

@ -69,7 +69,7 @@ impl PartialEq for FmtPart {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Literal(_, a), Self::Literal(_, b)) => a == b,
(Self::Spec(_ ,a, _), Self::Spec(_, b, _)) => a == b,
(Self::Spec(_, a, _), Self::Spec(_, b, _)) => a == b,
_ => false,
}
}

View file

@ -12,8 +12,7 @@ macro_rules! format_args {
};
}
pub use crate::args::Arguments;
pub use crate::opts::FmtOpts;
pub use crate::{args::Arguments, opts::FmtOpts};
pub type Result = std::result::Result<(), Error>;
@ -118,13 +117,14 @@ pub fn format<A: Arguments>(args: A) -> String {
/// Not part of the public API.
#[doc(hidden)]
mod _private {
pub use crate::args::{ConstWidthArg, DebugArg, DisplayArg, Str};
pub use crate::opts::{
WithAlternate, WithCenterAlign, WithFill, WithLeftAlign, WithRightAlign, WithWidth,
};
pub use mono_fmt_macro::__format_args;
pub use crate::{
args::{ConstWidthArg, DebugArg, DisplayArg, Str},
opts::{
WithAlternate, WithCenterAlign, WithFill, WithLeftAlign, WithRightAlign, WithWidth,
},
};
}
#[macro_export]

View file

@ -1,4 +1,4 @@
//! Copied modified stuff from core
mod num;
mod formatter;
mod num;

View file

@ -1,11 +1,12 @@
//! Integer and floating-point number formatting
use std::{
mem::MaybeUninit,
ops::{Div, Rem, Sub},
ptr, slice, str,
};
use crate::{self as fmt, FmtOpts, Write};
use std::mem::MaybeUninit;
use std::ops::{Div, Rem, Sub};
use std::ptr;
use std::slice;
use std::str;
mod numfmt {
//! Shared utilities used by both float and integer formatting.