mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
fix: error handling in main options examples
This commit is contained in:
parent
a3053119fa
commit
bb7c064bec
2 changed files with 6 additions and 4 deletions
|
@ -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)]
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue