String::from_str() -> to_string()

This commit is contained in:
Alexis Mousset
2014-11-05 17:34:39 +01:00
parent 96274074bc
commit f104d9075c
3 changed files with 12 additions and 12 deletions

View File

@@ -56,7 +56,7 @@ impl<S> Client<S> {
stream: None,
host: host,
port: port.unwrap_or(SMTP_PORT),
my_hostname: my_hostname.unwrap_or(String::from_str("localhost")),
my_hostname: my_hostname.unwrap_or("localhost".to_string()),
server_info: None,
state: transaction::Unconnected
}

View File

@@ -62,15 +62,15 @@ mod test {
#[test]
fn test_fmt() {
assert_eq!(format!("{}", ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: Some(vec!(extension::EightBitMime))
}), "name with [8BITMIME]".to_string());
assert_eq!(format!("{}", ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: Some(vec!(extension::EightBitMime, extension::Size(42)))
}), "name with [8BITMIME, SIZE=42]".to_string());
assert_eq!(format!("{}", ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: None
}), "name with no supported features".to_string());
}
@@ -78,19 +78,19 @@ mod test {
#[test]
fn test_supports_feature() {
assert_eq!(ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: Some(vec!(extension::EightBitMime))
}.supports_feature(extension::EightBitMime), Some(extension::EightBitMime));
assert_eq!(ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: Some(vec!(extension::Size(42), extension::EightBitMime))
}.supports_feature(extension::EightBitMime), Some(extension::EightBitMime));
assert_eq!(ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: Some(vec!(extension::Size(42), extension::EightBitMime))
}.supports_feature(extension::Size(0)), Some(extension::Size(42)));
assert!(ServerInfo{
name: String::from_str("name"),
name: "name".to_string(),
esmtp_features: Some(vec!(extension::EightBitMime))
}.supports_feature(extension::Size(42)).is_none());
}

View File

@@ -34,11 +34,11 @@
//! use std::string::String;
//!
//! let mut email_client: SmtpClient<TcpStream> =
//! SmtpClient::new(String::from_str("localhost"), None, None);
//! SmtpClient::new("localhost".to_string(), None, None);
//! email_client.send_mail::<TcpStream>(
//! String::from_str("user@example.com"),
//! vec!(String::from_str("user@example.org")),
//! String::from_str("Test email")
//! "user@example.com".to_string(),
//! vec!("user@example.org".to_string()),
//! "Test email".to_string()
//! );
//! ```