Code cleanup
This commit is contained in:
@@ -11,11 +11,10 @@ This library is designed for Rust 0.13.0-nightly (master).
|
||||
Install
|
||||
-------
|
||||
|
||||
If you're using `Cargo`, just add this to your `Cargo.toml`:
|
||||
If you're using the library in a program, just add this to your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
[dependencies.smtp]
|
||||
|
||||
git = "https://github.com/amousset/rust-smtp.git"
|
||||
```
|
||||
|
||||
@@ -33,12 +32,12 @@ INFO:smtp::client: from=<sender@localhost>, size=989, nrcpt=1
|
||||
INFO:smtp::client: to=<recipient@localhost>, status=sent (250 2.0.0 Ok: queued as 9D28F1C0A51)
|
||||
```
|
||||
|
||||
Run `./target/examples/client -h` to get a list of options.
|
||||
Run `./target/examples/client -h` to get a list of available options.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The documentation is available on [GitHub pages](http://amousset.github.io/rust-smtp/smtp/).
|
||||
You can build the documentation with `cargo doc`. It is also available on [GitHub pages](http://amousset.github.io/rust-smtp/smtp/).
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
// Copyright 2014 Alexis Mousset. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//! TODO
|
||||
|
||||
use std::io::net::tcp::TcpStream;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#![unstable]
|
||||
|
||||
use std::fmt::{Show, Formatter, Result};
|
||||
|
||||
use common::SP;
|
||||
|
||||
/// Supported SMTP commands
|
||||
@@ -110,20 +111,20 @@ mod test {
|
||||
fn test_fmt() {
|
||||
assert_eq!(
|
||||
format!("{}", super::Noop),
|
||||
format!("NOOP")
|
||||
"NOOP".to_string()
|
||||
);
|
||||
assert_eq!(
|
||||
format!("{}", super::ExtendedHello("my_name".to_string())),
|
||||
format!("EHLO my_name")
|
||||
"EHLO my_name".to_string()
|
||||
);
|
||||
assert_eq!(
|
||||
format!("{}", super::Mail("test".to_string(), Some(vec!("option".to_string())))),
|
||||
format!("MAIL FROM:<test> option")
|
||||
"MAIL FROM:<test> option".to_string()
|
||||
);
|
||||
assert_eq!(
|
||||
format!("{}", super::Mail("test".to_string(),
|
||||
Some(vec!("option".to_string(), "option2".to_string())))),
|
||||
format!("MAIL FROM:<test> option option2")
|
||||
"MAIL FROM:<test> option option2".to_string()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
|
||||
use std::from_str::FromStr;
|
||||
use std::fmt::{Show, Formatter, Result};
|
||||
use common::remove_trailing_crlf;
|
||||
use std::result;
|
||||
|
||||
use common::remove_trailing_crlf;
|
||||
|
||||
/// Contains an SMTP reply, with separed code and message
|
||||
///
|
||||
/// We do accept messages containing only a code, to comply with RFC5321
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
use std::fmt;
|
||||
use std::fmt::{Show, Formatter};
|
||||
|
||||
use command;
|
||||
use command::Command;
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
// Copyright 2014 Alexis Mousset. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[test]
|
||||
|
||||
fn foo() {
|
||||
|
||||
Reference in New Issue
Block a user