1414//! }
1515//!
1616//! fn main() {
17- //! let conn = Connection::connect("postgresql://postgres@localhost", & SslMode::None)
17+ //! let conn = Connection::connect("postgresql://postgres@localhost", SslMode::None)
1818//! .unwrap();
1919//!
2020//! conn.execute("CREATE TABLE person (
@@ -263,15 +263,15 @@ pub struct CancelData {
263263/// # use postgres::{Connection, SslMode};
264264/// # use std::thread;
265265/// # let url = "";
266- /// let conn = Connection::connect(url, & SslMode::None).unwrap();
266+ /// let conn = Connection::connect(url, SslMode::None).unwrap();
267267/// let cancel_data = conn.cancel_data();
268268/// thread::spawn(move || {
269269/// conn.execute("SOME EXPENSIVE QUERY", &[]).unwrap();
270270/// });
271- /// postgres::cancel_query(url, & SslMode::None, cancel_data).unwrap();
271+ /// postgres::cancel_query(url, SslMode::None, cancel_data).unwrap();
272272/// ```
273273pub fn cancel_query < T > ( params : T ,
274- ssl : & SslMode ,
274+ ssl : SslMode ,
275275 data : CancelData )
276276 -> result:: Result < ( ) , ConnectError >
277277 where T : IntoConnectParams
@@ -355,16 +355,16 @@ impl IsolationLevel {
355355}
356356
357357/// Specifies the SSL support requested for a new connection.
358- pub enum SslMode {
358+ pub enum SslMode < ' a > {
359359 /// The connection will not use SSL.
360360 None ,
361361 /// The connection will use SSL if the backend supports it.
362- Prefer ( Box < NegotiateSsl + std :: marker :: Sync + Send > ) ,
362+ Prefer ( & ' a NegotiateSsl ) ,
363363 /// The connection must use SSL.
364- Require ( Box < NegotiateSsl + std :: marker :: Sync + Send > ) ,
364+ Require ( & ' a NegotiateSsl ) ,
365365}
366366
367- impl fmt:: Debug for SslMode {
367+ impl < ' a > fmt:: Debug for SslMode < ' a > {
368368 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
369369 match * self {
370370 SslMode :: None => fmt. write_str ( "None" ) ,
@@ -404,7 +404,7 @@ impl Drop for InnerConnection {
404404}
405405
406406impl InnerConnection {
407- fn connect < T > ( params : T , ssl : & SslMode ) -> result:: Result < InnerConnection , ConnectError >
407+ fn connect < T > ( params : T , ssl : SslMode ) -> result:: Result < InnerConnection , ConnectError >
408408 where T : IntoConnectParams
409409 {
410410 let params = try!( params. into_connect_params ( ) . map_err ( ConnectError :: BadConnectParams ) ) ;
@@ -874,14 +874,14 @@ impl Connection {
874874 /// use postgres::{Connection, SslMode};
875875 ///
876876 /// let url = "postgresql://postgres:hunter2@localhost:2994/foodb";
877- /// let conn = Connection::connect(url, & SslMode::None).unwrap();
877+ /// let conn = Connection::connect(url, SslMode::None).unwrap();
878878 /// ```
879879 ///
880880 /// ```rust,no_run
881881 /// use postgres::{Connection, SslMode};
882882 ///
883883 /// let url = "postgresql://postgres@%2Frun%2Fpostgres";
884- /// let conn = Connection::connect(url, & SslMode::None).unwrap();
884+ /// let conn = Connection::connect(url, SslMode::None).unwrap();
885885 /// ```
886886 ///
887887 /// ```rust,no_run
@@ -900,10 +900,10 @@ impl Connection {
900900 /// database: None,
901901 /// options: vec![],
902902 /// };
903- /// let conn = Connection::connect(params, & SslMode::None).unwrap();
903+ /// let conn = Connection::connect(params, SslMode::None).unwrap();
904904 /// # }
905905 /// ```
906- pub fn connect < T > ( params : T , ssl : & SslMode ) -> result:: Result < Connection , ConnectError >
906+ pub fn connect < T > ( params : T , ssl : SslMode ) -> result:: Result < Connection , ConnectError >
907907 where T : IntoConnectParams
908908 {
909909 InnerConnection :: connect ( params, ssl) . map ( |conn| Connection { conn : RefCell :: new ( conn) } )
@@ -966,7 +966,7 @@ impl Connection {
966966 ///
967967 /// ```rust,no_run
968968 /// # use postgres::{Connection, SslMode};
969- /// # let conn = Connection::connect("", & SslMode::None).unwrap();
969+ /// # let conn = Connection::connect("", SslMode::None).unwrap();
970970 /// let trans = conn.transaction().unwrap();
971971 /// trans.execute("UPDATE foo SET bar = 10", &[]).unwrap();
972972 /// // ...
@@ -1002,7 +1002,7 @@ impl Connection {
10021002 /// ```rust,no_run
10031003 /// # use postgres::{Connection, SslMode};
10041004 /// # let x = 10i32;
1005- /// # let conn = Connection::connect("", & SslMode::None).unwrap();
1005+ /// # let conn = Connection::connect("", SslMode::None).unwrap();
10061006 /// let stmt = conn.prepare("SELECT foo FROM bar WHERE baz = $1").unwrap();
10071007 /// for row in &stmt.query(&[&x]).unwrap() {
10081008 /// let foo: String = row.get(0);
@@ -1025,7 +1025,7 @@ impl Connection {
10251025 /// ```rust,no_run
10261026 /// # use postgres::{Connection, SslMode};
10271027 /// # let x = 10i32;
1028- /// # let conn = Connection::connect("", & SslMode::None).unwrap();
1028+ /// # let conn = Connection::connect("", SslMode::None).unwrap();
10291029 /// let stmt = conn.prepare_cached("SELECT foo FROM bar WHERE baz = $1").unwrap();
10301030 /// for row in &stmt.query(&[&x]).unwrap() {
10311031 /// let foo: String = row.get(0);
@@ -1075,7 +1075,7 @@ impl Connection {
10751075 ///
10761076 /// ```rust,no_run
10771077 /// # use postgres::{Connection, SslMode, Result};
1078- /// # let conn = Connection::connect("", & SslMode::None).unwrap();
1078+ /// # let conn = Connection::connect("", SslMode::None).unwrap();
10791079 /// conn.batch_execute("
10801080 /// CREATE TABLE person (
10811081 /// id SERIAL PRIMARY KEY,
0 commit comments