From 01c4be82c8e74f0d6889df33339be64b6ca90ef1 Mon Sep 17 00:00:00 2001 From: gwenn Date: Wed, 5 Jan 2022 19:19:13 +0100 Subject: [PATCH] clippy::doc_markdown --- src/config.rs | 28 ++++++++++++++-------------- src/functions.rs | 2 +- src/hooks.rs | 4 ++-- src/lib.rs | 2 +- src/params.rs | 2 +- src/row.rs | 2 +- src/util/small_cstr.rs | 4 ++-- src/util/sqlite_string.rs | 8 ++++---- src/vtab/mod.rs | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/config.rs b/src/config.rs index 64e1df1..7876bec 100644 --- a/src/config.rs +++ b/src/config.rs @@ -64,17 +64,17 @@ pub enum DbConfig { impl Connection { /// Returns the current value of a `config`. /// - /// - SQLITE_DBCONFIG_ENABLE_FKEY: return `false` or `true` to indicate + /// - `SQLITE_DBCONFIG_ENABLE_FKEY`: return `false` or `true` to indicate /// whether FK enforcement is off or on - /// - SQLITE_DBCONFIG_ENABLE_TRIGGER: return `false` or `true` to indicate + /// - `SQLITE_DBCONFIG_ENABLE_TRIGGER`: return `false` or `true` to indicate /// whether triggers are disabled or enabled - /// - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: return `false` or `true` to - /// indicate whether fts3_tokenizer are disabled or enabled - /// - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: return `false` to indicate + /// - `SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER`: return `false` or `true` to + /// indicate whether `fts3_tokenizer` are disabled or enabled + /// - `SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE`: return `false` to indicate /// checkpoints-on-close are not disabled or `true` if they are - /// - SQLITE_DBCONFIG_ENABLE_QPSG: return `false` or `true` to indicate + /// - `SQLITE_DBCONFIG_ENABLE_QPSG`: return `false` or `true` to indicate /// whether the QPSG is disabled or enabled - /// - SQLITE_DBCONFIG_TRIGGER_EQP: return `false` to indicate + /// - `SQLITE_DBCONFIG_TRIGGER_EQP`: return `false` to indicate /// output-for-trigger are not disabled or `true` if it is #[inline] pub fn db_config(&self, config: DbConfig) -> Result { @@ -93,17 +93,17 @@ impl Connection { /// Make configuration changes to a database connection /// - /// - SQLITE_DBCONFIG_ENABLE_FKEY: `false` to disable FK enforcement, `true` + /// - `SQLITE_DBCONFIG_ENABLE_FKEY`: `false` to disable FK enforcement, `true` /// to enable FK enforcement - /// - SQLITE_DBCONFIG_ENABLE_TRIGGER: `false` to disable triggers, `true` to + /// - `SQLITE_DBCONFIG_ENABLE_TRIGGER`: `false` to disable triggers, `true` to /// enable triggers - /// - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: `false` to disable - /// fts3_tokenizer(), `true` to enable fts3_tokenizer() - /// - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: `false` (the default) to enable + /// - `SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER`: `false` to disable + /// `fts3_tokenizer()`, `true` to enable `fts3_tokenizer()` + /// - `SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE`: `false` (the default) to enable /// checkpoints-on-close, `true` to disable them - /// - SQLITE_DBCONFIG_ENABLE_QPSG: `false` to disable the QPSG, `true` to + /// - `SQLITE_DBCONFIG_ENABLE_QPSG`: `false` to disable the QPSG, `true` to /// enable QPSG - /// - SQLITE_DBCONFIG_TRIGGER_EQP: `false` to disable output for trigger + /// - `SQLITE_DBCONFIG_TRIGGER_EQP`: `false` to disable output for trigger /// programs, `true` to enable it #[inline] pub fn set_db_config(&self, config: DbConfig, new_val: bool) -> Result { diff --git a/src/functions.rs b/src/functions.rs index 3006a79..c19d843 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -287,7 +287,7 @@ where fn finalize(&self, _: &mut Context<'_>, _: Option) -> Result; } -/// WindowAggregate is the callback interface for +/// `WindowAggregate` is the callback interface for /// user-defined aggregate window function. #[cfg(feature = "window")] #[cfg_attr(docsrs, doc(cfg(feature = "window")))] diff --git a/src/hooks.rs b/src/hooks.rs index c15bdfc..e92c868 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -367,8 +367,8 @@ impl Connection { /// /// The callback parameters are: /// - /// - the type of database update (SQLITE_INSERT, SQLITE_UPDATE or - /// SQLITE_DELETE), + /// - the type of database update (`SQLITE_INSERT`, `SQLITE_UPDATE` or + /// `SQLITE_DELETE`), /// - the name of the database ("main", "temp", ...), /// - the name of the table that is updated, /// - the ROWID of the row that is updated. diff --git a/src/lib.rs b/src/lib.rs index ec9c96f..ac91720 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -450,7 +450,7 @@ impl Connection { /// /// # Failure /// - /// Will return `Err` if vfs` cannot be converted to a C-compatible + /// Will return `Err` if `vfs` cannot be converted to a C-compatible /// string or if the underlying SQLite open call fails. #[inline] pub fn open_in_memory_with_flags_and_vfs(flags: OpenFlags, vfs: &str) -> Result { diff --git a/src/params.rs b/src/params.rs index ddbe8a8..54aa571 100644 --- a/src/params.rs +++ b/src/params.rs @@ -99,7 +99,7 @@ use sealed::Sealed; /// /// - As a slice of `&[(&str, &dyn ToSql)]`. This is what essentially all of /// these boil down to in the end, conceptually at least. In theory you can -/// pass this as `stmt. +/// pass this as `stmt`. /// /// - As array references, similar to the positional params. This looks like /// `thing.query(&[(":foo", &1i32), (":bar", &2i32)])` or diff --git a/src/row.rs b/src/row.rs index 675bed1..52636bd 100644 --- a/src/row.rs +++ b/src/row.rs @@ -187,7 +187,7 @@ where /// `FallibleStreamingIterator` differs from the standard library's `Iterator` /// in two ways: -/// * each call to `next` (sqlite3_step) can fail. +/// * each call to `next` (`sqlite3_step`) can fail. /// * returned `Row` is valid until `next` is called again or `Statement` is /// reset or finalized. /// diff --git a/src/util/small_cstr.rs b/src/util/small_cstr.rs index 7349df0..1d418fd 100644 --- a/src/util/small_cstr.rs +++ b/src/util/small_cstr.rs @@ -1,7 +1,7 @@ use smallvec::{smallvec, SmallVec}; use std::ffi::{CStr, CString, NulError}; -/// Similar to std::ffi::CString, but avoids heap allocating if the string is +/// Similar to `std::ffi::CString`, but avoids heap allocating if the string is /// small enough. Also guarantees it's input is UTF-8 -- used for cases where we /// need to pass a NUL-terminated string to SQLite, and we have a `&str`. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] @@ -31,7 +31,7 @@ impl SmallCString { /// Get the bytes not including the NUL terminator. E.g. the bytes which /// make up our `str`: /// - `SmallCString::new("foo").as_bytes_without_nul() == b"foo"` - /// - `SmallCString::new("foo").as_bytes_with_nul() == b"foo\0" + /// - `SmallCString::new("foo").as_bytes_with_nul() == b"foo\0"` #[inline] pub fn as_bytes_without_nul(&self) -> &[u8] { self.debug_checks(); diff --git a/src/util/sqlite_string.rs b/src/util/sqlite_string.rs index d131b56..ce492b1 100644 --- a/src/util/sqlite_string.rs +++ b/src/util/sqlite_string.rs @@ -38,7 +38,7 @@ pub(crate) struct SqliteMallocString { impl SqliteMallocString { /// SAFETY: Caller must be certain that `m` a nul-terminated c string - /// allocated by sqlite3_malloc, and that SQLite expects us to free it! + /// allocated by `sqlite3_malloc`, and that SQLite expects us to free it! #[inline] pub(crate) unsafe fn from_raw_nonnull(ptr: NonNull) -> Self { Self { @@ -48,7 +48,7 @@ impl SqliteMallocString { } /// SAFETY: Caller must be certain that `m` a nul-terminated c string - /// allocated by sqlite3_malloc, and that SQLite expects us to free it! + /// allocated by `sqlite3_malloc`, and that SQLite expects us to free it! #[inline] pub(crate) unsafe fn from_raw(ptr: *mut c_char) -> Option { NonNull::new(ptr).map(|p| Self::from_raw_nonnull(p)) @@ -95,13 +95,13 @@ impl SqliteMallocString { /// If `s` contains internal NULs, we'll replace them with /// `NUL_REPLACE_CHAR`. /// - /// Except for debug_asserts which may trigger during testing, this function + /// Except for `debug_assert`s which may trigger during testing, this function /// never panics. If we hit integer overflow or the allocation fails, we /// call `handle_alloc_error` which aborts the program after calling a /// global hook. /// /// This means it's safe to use in extern "C" functions even outside of - /// catch_unwind. + /// `catch_unwind`. pub(crate) fn from_str(s: &str) -> Self { use std::convert::TryFrom; let s = if s.as_bytes().contains(&0) { diff --git a/src/vtab/mod.rs b/src/vtab/mod.rs index 929d599..77fa34b 100644 --- a/src/vtab/mod.rs +++ b/src/vtab/mod.rs @@ -193,7 +193,7 @@ impl VTabConnection { /// /// # Safety /// -/// The first item in a struct implementing VTab must be +/// The first item in a struct implementing `VTab` must be /// `rusqlite::sqlite3_vtab`, and the struct must be `#[repr(C)]`. /// /// ```rust,ignore