mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-14 15:25:08 +01:00
fmt
This commit is contained in:
parent
505a8f80d5
commit
166b495586
5 changed files with 19 additions and 15 deletions
3
.rustfmt.toml
Normal file
3
.rustfmt.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
imports_granularity = "Crate"
|
||||||
|
newline_style = "Unix"
|
||||||
|
group_imports = "StdExternalCrate"
|
||||||
|
|
@ -69,7 +69,7 @@ impl PartialEq for FmtPart {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
(Self::Literal(_, a), Self::Literal(_, b)) => a == b,
|
(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,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
src/lib.rs
16
src/lib.rs
|
|
@ -12,8 +12,7 @@ macro_rules! format_args {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use crate::args::Arguments;
|
pub use crate::{args::Arguments, opts::FmtOpts};
|
||||||
pub use crate::opts::FmtOpts;
|
|
||||||
|
|
||||||
pub type Result = std::result::Result<(), Error>;
|
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.
|
/// Not part of the public API.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
mod _private {
|
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 mono_fmt_macro::__format_args;
|
||||||
|
|
||||||
|
pub use crate::{
|
||||||
|
args::{ConstWidthArg, DebugArg, DisplayArg, Str},
|
||||||
|
opts::{
|
||||||
|
WithAlternate, WithCenterAlign, WithFill, WithLeftAlign, WithRightAlign, WithWidth,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
//! Copied modified stuff from core
|
//! Copied modified stuff from core
|
||||||
|
|
||||||
|
mod formatter;
|
||||||
mod num;
|
mod num;
|
||||||
mod formatter;
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
//! Integer and floating-point number formatting
|
//! 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 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 {
|
mod numfmt {
|
||||||
//! Shared utilities used by both float and integer formatting.
|
//! Shared utilities used by both float and integer formatting.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue