mirror of
https://github.com/Noratrieb/jsonformat.git
synced 2026-01-14 22:25:01 +01:00
prepare for release
This commit is contained in:
parent
35332a1b26
commit
7aed458197
4 changed files with 30 additions and 14 deletions
12
src/lib.rs
12
src/lib.rs
|
|
@ -14,8 +14,12 @@ use std::{
|
|||
/// but nothing is stopping you from doing that.
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
|
||||
pub enum Indentation<'a> {
|
||||
/// Use the default indentation, which is two spaces
|
||||
/// Fast path for two spaces
|
||||
TwoSpace,
|
||||
/// Fast path for four spaces
|
||||
FourSpace,
|
||||
/// Fast path for tab
|
||||
Tab,
|
||||
/// Use a custom indentation String
|
||||
Custom(&'a str),
|
||||
}
|
||||
|
|
@ -142,6 +146,12 @@ where
|
|||
Indentation::TwoSpace => {
|
||||
writer.write_all(b" ")?;
|
||||
}
|
||||
Indentation::FourSpace => {
|
||||
writer.write_all(b" ")?;
|
||||
}
|
||||
Indentation::Tab => {
|
||||
writer.write_all(b"\t")?;
|
||||
}
|
||||
Indentation::Custom(indent) => {
|
||||
writer.write_all(indent.as_bytes())?;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue