From bb7c064bec4a77769229afb800ffdbde9ef1e749 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Mon, 1 Jun 2020 05:35:13 -0700 Subject: [PATCH] fix: error handling in main options examples --- sqlx-core/src/mysql/options.rs | 5 +++-- sqlx-core/src/postgres/options.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sqlx-core/src/mysql/options.rs b/sqlx-core/src/mysql/options.rs index a3259f76..3720f444 100644 --- a/sqlx-core/src/mysql/options.rs +++ b/sqlx-core/src/mysql/options.rs @@ -75,7 +75,7 @@ impl FromStr for MySqlSslMode { /// # use sqlx_core::connection::Connect; /// # use sqlx_core::mysql::{MySqlConnectOptions, MySqlConnection, MySqlSslMode}; /// # -/// # fn main() { +/// # fn main() -> Result<(), Error> { /// # #[cfg(feature = "runtime-async-std")] /// # sqlx_rt::async_std::task::block_on(async move { /// // URI connection string @@ -88,7 +88,8 @@ impl FromStr for MySqlSslMode { /// .password("password") /// .database("db") /// ).await?; -/// # }).unwrap(); +/// # Ok(()) +/// # }) /// # } /// ``` #[derive(Debug, Clone)] diff --git a/sqlx-core/src/postgres/options.rs b/sqlx-core/src/postgres/options.rs index c77396fa..b59a332f 100644 --- a/sqlx-core/src/postgres/options.rs +++ b/sqlx-core/src/postgres/options.rs @@ -88,7 +88,7 @@ impl FromStr for PgSslMode { /// # use sqlx_core::connection::Connect; /// # use sqlx_core::postgres::{PgConnectOptions, PgConnection, PgSslMode}; /// # -/// # fn main() { +/// # fn main() -> Result<(), Error> { /// # #[cfg(feature = "runtime-async-std")] /// # sqlx_rt::async_std::task::block_on(async move { /// // URI connection string @@ -102,7 +102,8 @@ impl FromStr for PgSslMode { /// .password("secret-password") /// .ssl_mode(PgSslMode::Require) /// ).await?; -/// # }).unwrap(); +/// # Ok(()) +/// # }) /// # } /// ``` #[derive(Debug, Clone)]