diff options
author | Alexandros Frantzis <alf82@freemail.gr> | 2019-10-01 23:06:38 +0300 |
---|---|---|
committer | Alexandros Frantzis <alf82@freemail.gr> | 2019-10-01 23:36:26 +0300 |
commit | a054789ddb60ed1fab26e6d4e6bd36ed926273f1 (patch) | |
tree | bd3caad78a0e377816b78276889301d9276344b9 /examples/normalize.rs |
Initial public release
Diffstat (limited to 'examples/normalize.rs')
-rw-r--r-- | examples/normalize.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/normalize.rs b/examples/normalize.rs new file mode 100644 index 0000000..359250a --- /dev/null +++ b/examples/normalize.rs @@ -0,0 +1,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(()) +} |