|
29 | 29 | //! )", &[]).unwrap(); |
30 | 30 | //! let me = Person { |
31 | 31 | //! id: 0, |
32 | | -//! name: "Steven".into_string(), |
| 32 | +//! name: "Steven".to_string(), |
33 | 33 | //! time_created: time::get_time(), |
34 | 34 | //! data: None |
35 | 35 | //! }; |
@@ -65,6 +65,7 @@ extern crate time; |
65 | 65 | use openssl::crypto::hash::{HashType, Hasher}; |
66 | 66 | use openssl::ssl::{SslContext, MaybeSslStream}; |
67 | 67 | use serialize::hex::ToHex; |
| 68 | +use std::borrow::ToOwned; |
68 | 69 | use std::cell::{Cell, RefCell}; |
69 | 70 | use std::cmp::max; |
70 | 71 | use std::collections::{RingBuf, HashMap}; |
@@ -182,7 +183,7 @@ impl IntoConnectParams for Url { |
182 | 183 | }); |
183 | 184 |
|
184 | 185 | // path contains the leading / |
185 | | - let database = path.slice_shift_char().map(|(_, path)| path.into_string()); |
| 186 | + let database = path.slice_shift_char().map(|(_, path)| path.to_owned()); |
186 | 187 |
|
187 | 188 | Ok(ConnectParams { |
188 | 189 | target: target, |
@@ -414,14 +415,14 @@ impl InnerConnection { |
414 | 415 | canary: CANARY, |
415 | 416 | }; |
416 | 417 |
|
417 | | - options.push(("client_encoding".into_string(), "UTF8".into_string())); |
| 418 | + options.push(("client_encoding".to_owned(), "UTF8".to_owned())); |
418 | 419 | // Postgres uses the value of TimeZone as the time zone for TIMESTAMP |
419 | 420 | // WITH TIME ZONE values. Timespec converts to GMT internally. |
420 | | - options.push(("TimeZone".into_string(), "GMT".into_string())); |
| 421 | + options.push(("TimeZone".to_owned(), "GMT".to_owned())); |
421 | 422 | // We have to clone here since we need the user again for auth |
422 | | - options.push(("user".into_string(), user.user.clone())); |
| 423 | + options.push(("user".to_owned(), user.user.clone())); |
423 | 424 | if let Some(database) = database { |
424 | | - options.push(("database".into_string(), database)); |
| 425 | + options.push(("database".to_owned(), database)); |
425 | 426 | } |
426 | 427 |
|
427 | 428 | try!(conn.write_messages(&[StartupMessage { |
@@ -743,7 +744,7 @@ impl InnerConnection { |
743 | 744 | ReadyForQuery { .. } => break, |
744 | 745 | DataRow { row } => { |
745 | 746 | result.push(row.into_iter().map(|opt| { |
746 | | - opt.map(|b| String::from_utf8_lossy(&*b).into_string()) |
| 747 | + opt.map(|b| String::from_utf8_lossy(&*b).into_owned()) |
747 | 748 | }).collect()); |
748 | 749 | } |
749 | 750 | CopyInResponse { .. } => { |
@@ -822,7 +823,7 @@ impl Connection { |
822 | 823 | /// target: ConnectTarget::Unix(some_crazy_path), |
823 | 824 | /// port: None, |
824 | 825 | /// user: Some(UserInfo { |
825 | | - /// user: "postgres".into_string(), |
| 826 | + /// user: "postgres".to_string(), |
826 | 827 | /// password: None |
827 | 828 | /// }), |
828 | 829 | /// database: None, |
@@ -895,7 +896,7 @@ impl Connection { |
895 | 896 | /// )", &[])); |
896 | 897 | /// |
897 | 898 | /// let stmt = try!(conn.prepare_copy_in("foo", &["bar", "baz"])); |
898 | | - /// let data: &[&[&ToSql]] = &[&[&0i32, &"blah".into_string()], |
| 899 | + /// let data: &[&[&ToSql]] = &[&[&0i32, &"blah"], |
899 | 900 | /// &[&1i32, &None::<String>]]; |
900 | 901 | /// try!(stmt.execute(data.iter().map(|r| r.iter().map(|&e| e)))); |
901 | 902 | /// # Ok(()) }; |
@@ -959,7 +960,7 @@ impl Connection { |
959 | 960 | let (param_types, result_desc) = try!(self.conn.borrow_mut().raw_prepare("", query)); |
960 | 961 | let stmt = Statement { |
961 | 962 | conn: self, |
962 | | - name: "".into_string(), |
| 963 | + name: "".to_owned(), |
963 | 964 | param_types: param_types, |
964 | 965 | result_desc: result_desc, |
965 | 966 | next_portal_id: Cell::new(0), |
|
0 commit comments