fix: error handling in main options examples

This commit is contained in:
Ryan Leckey 2020-06-01 05:35:13 -07:00
parent a3053119fa
commit bb7c064bec
2 changed files with 6 additions and 4 deletions

View file

@ -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)]

View file

@ -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)]