prepare for release

This commit is contained in:
nora 2022-04-28 21:16:43 +02:00
parent 35332a1b26
commit 7aed458197
4 changed files with 30 additions and 14 deletions

View file

@ -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())?;
}