Code cleanup

This commit is contained in:
Alexis Mousset
2014-11-05 02:39:32 +01:00
parent d5206ddeb1
commit 9272272c24
6 changed files with 29 additions and 9 deletions

View File

@@ -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
-------

View File

@@ -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;

View File

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

View File

@@ -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

View File

@@ -13,6 +13,7 @@
use std::fmt;
use std::fmt::{Show, Formatter};
use command;
use command::Command;

View File

@@ -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() {