diff --git a/src/client/mod.rs b/src/client/mod.rs index 4ff8ca8..ab84e75 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -56,7 +56,7 @@ impl Client { 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 } diff --git a/src/client/server_info.rs b/src/client/server_info.rs index ee45f50..6ecdcbf 100644 --- a/src/client/server_info.rs +++ b/src/client/server_info.rs @@ -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()); } diff --git a/src/lib.rs b/src/lib.rs index 9b2da58..2265509 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,11 +34,11 @@ //! use std::string::String; //! //! let mut email_client: SmtpClient = -//! SmtpClient::new(String::from_str("localhost"), None, None); +//! SmtpClient::new("localhost".to_string(), None, None); //! email_client.send_mail::( -//! 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() //! ); //! ```