@@ -3,7 +3,7 @@ Rust-Postgres is a pure-Rust frontend for the popular PostgreSQL database. It
33exposes a high level interface in the vein of JDBC or Go's `database/sql`
44package.
55
6- ```rust
6+ ```rust,no_run
77extern crate postgres;
88extern crate time;
99
@@ -19,7 +19,6 @@ struct Person {
1919 data: Option<~[u8]>
2020}
2121
22- # fn main() {
2322fn main() {
2423 let conn = PostgresConnection::connect("postgres://postgres@localhost",
2524 &NoSsl);
@@ -52,7 +51,6 @@ fn main() {
5251 println!("Found person {}", person.name);
5352 }
5453}
55- # }
5654```
5755 */
5856
@@ -270,10 +268,7 @@ pub struct PostgresCancelData {
270268///
271269/// # Example
272270///
273- /// ```rust
274- /// # extern crate postgres;
275- /// # fn main() {}
276- /// # fn foo() {
271+ /// ```rust,no_run
277272/// # use postgres::{PostgresConnection, NoSsl};
278273/// # let url = "";
279274/// let conn = PostgresConnection::connect(url, &NoSsl);
@@ -283,7 +278,6 @@ pub struct PostgresCancelData {
283278/// });
284279/// # let _ =
285280/// postgres::cancel_query(url, &NoSsl, cancel_data);
286- /// # }
287281/// ```
288282pub fn cancel_query ( url : & str , ssl : & SslMode , data : PostgresCancelData )
289283 -> Result < ( ) , PostgresConnectError > {
@@ -712,17 +706,14 @@ impl PostgresConnection {
712706 ///
713707 /// # Example
714708 ///
715- /// ```rust
716- /// # fn main() {}
717- /// # fn foo() {
709+ /// ```rust,no_run
718710 /// # use postgres::{PostgresConnection, NoSsl};
719711 /// let url = "postgres://postgres:hunter2@localhost:2994/foodb";
720712 /// let maybe_conn = PostgresConnection::try_connect(url, &NoSsl);
721713 /// let conn = match maybe_conn {
722714 /// Ok(conn) => conn,
723715 /// Err(err) => fail!("Error connecting: {}", err)
724716 /// };
725- /// # }
726717 /// ```
727718 pub fn try_connect ( url : & str , ssl : & SslMode )
728719 -> Result < PostgresConnection , PostgresConnectError > {
@@ -772,17 +763,14 @@ impl PostgresConnection {
772763 ///
773764 /// # Example
774765 ///
775- /// ```rust
766+ /// ```rust,no_run
776767 /// # use postgres::{PostgresConnection, NoSsl};
777- /// # fn main() {}
778- /// # fn foo() {
779768 /// # let conn = PostgresConnection::connect("", &NoSsl);
780769 /// let maybe_stmt = conn.try_prepare("SELECT foo FROM bar WHERE baz = $1");
781770 /// let stmt = match maybe_stmt {
782771 /// Ok(stmt) => stmt,
783772 /// Err(err) => fail!("Error preparing statement: {}", err)
784773 /// };
785- /// # }
786774 pub fn try_prepare < ' a > ( & ' a self , query : & str )
787775 -> Result < NormalPostgresStatement < ' a > , PostgresError > {
788776 self . conn . with_mut ( |conn| conn. try_prepare ( query, self ) )
@@ -811,9 +799,8 @@ impl PostgresConnection {
811799 ///
812800 /// # Example
813801 ///
814- /// ```rust
802+ /// ```rust,no_run
815803 /// # use postgres::{PostgresConnection, NoSsl};
816- /// # fn main() {}
817804 /// # fn foo() -> Result<(), postgres::error::PostgresError> {
818805 /// # let conn = PostgresConnection::connect("", &NoSsl);
819806 /// let trans = try!(conn.try_transaction());
0 commit comments