From 147168184fe60f1bc42ab2261ba486f0025766a1 Mon Sep 17 00:00:00 2001 From: gwenn Date: Mon, 24 Jun 2019 20:05:36 +0200 Subject: [PATCH] rustdoc: example for Connection::open file --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9e38bdb..6360ddd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -338,6 +338,16 @@ impl Connection { /// OpenFlags::SQLITE_OPEN_READ_WRITE | /// OpenFlags::SQLITE_OPEN_CREATE)`. /// + /// ```rust,no_run + /// # use rusqlite::{Connection, Result}; + /// fn open_my_db() -> Result<()> { + /// let path = "./my_db.db3"; + /// let db = Connection::open(&path)?; + /// println!("{}", db.is_autocommit()); + /// Ok(()) + /// } + /// ``` + /// /// # Failure /// /// Will return `Err` if `path` cannot be converted to a C-compatible