deindent 1.0.1

A command line utility and Rust library to format overly-indented text.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use deindent::Deindenter;
use std::io::{self, Read, Result};

fn main() -> Result<()> {
    let mut input = String::new();
    io::stdin().read_to_string(&mut input).unwrap();

    let Some(deindenter) = Deindenter::new(&input) else {
        return Ok(());
    };

    let mut out = io::stdout().lock();
    deindenter.to_writer(&mut out)
}