summaryrefslogtreecommitdiffstats
path: root/examples/normalize.rs
blob: 359250adb3cd8fe3d898be69ef5cf7e766d60371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2019 Alexandros Frantzis
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//
// SPDX-License-Identifier: MPL-2.0

//! Writes out the normalized form of an email.

use std::io::{self, Write};
use mda::{Email, Result};

fn main() -> Result<()> {
    let email = Email::from_stdin()?;
    io::stdout().lock().write_all(email.data())?;
    Ok(())
}