From 0890313259fabb5d365561e784a92f92f858460f Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Fri, 24 Jul 2020 00:31:05 +0900 Subject: [PATCH] doc: fix wrong links --- sqlx-core/src/error.rs | 2 +- sqlx-core/src/executor.rs | 10 +++++----- sqlx-core/src/query.rs | 8 ++++---- sqlx-core/src/query_as.rs | 4 ++-- sqlx-core/src/query_scalar.rs | 4 ++-- sqlx-core/src/row.rs | 21 ++++++++++----------- sqlx-core/src/value.rs | 4 ++-- src/macros.rs | 2 +- 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/sqlx-core/src/error.rs b/sqlx-core/src/error.rs index d2554f20..a6e9f903 100644 --- a/sqlx-core/src/error.rs +++ b/sqlx-core/src/error.rs @@ -20,7 +20,7 @@ pub type BoxDynError = Box; /// An unexpected `NULL` was encountered during decoding. /// -/// Returned from [`Row::get`] if the value from the database is `NULL`, +/// Returned from [`Row::get`](sqlx_core::row::Row::get) if the value from the database is `NULL`, /// and you are not decoding into an `Option`. #[derive(thiserror::Error, Debug)] #[error("unexpected null; try decoding as an `Option`")] diff --git a/sqlx-core/src/executor.rs b/sqlx-core/src/executor.rs index 956ca377..cb7925f2 100644 --- a/sqlx-core/src/executor.rs +++ b/sqlx-core/src/executor.rs @@ -18,9 +18,9 @@ use std::fmt::Debug; /// /// Implemented for the following: /// -/// * [`&Pool`] -/// * [`&mut PoolConnection`] -/// * [`&mut Connection`] +/// * [`&Pool`](super::pool::Pool) +/// * [`&mut PoolConnection`](super::pool::PoolConnection) +/// * [`&mut Connection`](super::connection::Connection) /// pub trait Executor<'c>: Send + Debug + Sized { type Database: Database; @@ -148,8 +148,8 @@ pub trait Executor<'c>: Send + Debug + Sized { /// /// Implemented for the following: /// -/// * [`&str`] -/// * [`Query`] +/// * [`&str`](std::str) +/// * [`Query`](super::query::Query) /// pub trait Execute<'q, DB: Database>: Send + Sized { /// Returns the query string that will be executed. diff --git a/sqlx-core/src/query.rs b/sqlx-core/src/query.rs index d03fdd34..079f411b 100644 --- a/sqlx-core/src/query.rs +++ b/sqlx-core/src/query.rs @@ -76,8 +76,8 @@ where /// /// See [`try_map`](Query::try_map) for a fallible version of this method. /// - /// The [`query_as`](crate::query_as::query_as) method will construct a mapped query using - /// a [`FromRow`](crate::row::FromRow) implementation. + /// The [`query_as`](super::query_as::query_as) method will construct a mapped query using + /// a [`FromRow`](super::from_row::FromRow) implementation. #[inline] pub fn map(self, f: F) -> Map<'q, DB, impl TryMapRow, A> where @@ -89,8 +89,8 @@ where /// Map each row in the result to another type. /// - /// The [`query_as`](crate::query_as::query_as) method will construct a mapped query using - /// a [`FromRow`](crate::row::FromRow) implementation. + /// The [`query_as`](super::query_as::query_as) method will construct a mapped query using + /// a [`FromRow`](super::from_row::FromRow) implementation. #[inline] pub fn try_map(self, f: F) -> Map<'q, DB, F, A> where diff --git a/sqlx-core/src/query_as.rs b/sqlx-core/src/query_as.rs index 877bf99c..56e67db3 100644 --- a/sqlx-core/src/query_as.rs +++ b/sqlx-core/src/query_as.rs @@ -142,7 +142,7 @@ where } /// Make a SQL query that is mapped to a concrete type -/// using [`FromRow`](crate::row::FromRow). +/// using [`FromRow`]. #[inline] pub fn query_as<'q, DB, O>(sql: &'q str) -> QueryAs<'q, DB, O, >::Arguments> where @@ -156,7 +156,7 @@ where } /// Make a SQL query, with the given arguments, that is mapped to a concrete type -/// using [`FromRow`](crate::row::FromRow). +/// using [`FromRow`]. #[inline] pub fn query_as_with<'q, DB, O, A>(sql: &'q str, arguments: A) -> QueryAs<'q, DB, O, A> where diff --git a/sqlx-core/src/query_scalar.rs b/sqlx-core/src/query_scalar.rs index 370bf441..df9424a0 100644 --- a/sqlx-core/src/query_scalar.rs +++ b/sqlx-core/src/query_scalar.rs @@ -130,7 +130,7 @@ where } /// Make a SQL query that is mapped to a single concrete type -/// using [`FromRow`](crate::row::FromRow). +/// using [`FromRow`]. #[inline] pub fn query_scalar<'q, DB, O>( sql: &'q str, @@ -145,7 +145,7 @@ where } /// Make a SQL query, with the given arguments, that is mapped to a single concrete type -/// using [`FromRow`](crate::row::FromRow). +/// using [`FromRow`]. #[inline] pub fn query_scalar_with<'q, DB, O, A>(sql: &'q str, arguments: A) -> QueryScalar<'q, DB, O, A> where diff --git a/sqlx-core/src/row.rs b/sqlx-core/src/row.rs index 74546f1b..14fd06c7 100644 --- a/sqlx-core/src/row.rs +++ b/sqlx-core/src/row.rs @@ -15,9 +15,8 @@ use crate::value::ValueRef; /// /// This trait is sealed and cannot be implemented for types outside of SQLx. /// -/// [`Row`]: trait.Row.html -/// [`get`]: trait.Row.html#method.get -/// [`try_get`]: trait.Row.html#method.try_get +/// [`get`]: Row::get +/// [`try_get`]: Row::try_get /// pub trait ColumnIndex: private_column_index::Sealed + Debug { /// Returns a valid positional index into the row, [`ColumnIndexOutOfBounds`], or, @@ -158,9 +157,9 @@ pub trait Row: private_row::Sealed + Unpin + Send + Sync + 'static { /// * [`ColumnIndexOutOfBounds`] if the `usize` index was greater than the number of columns in the row. /// * [`ColumnDecode`] if the value could not be decoded into the requested type. /// - /// [`ColumnDecode`]: crate::Error::ColumnDecode - /// [`ColumnNotFound`]: crate::Error::ColumnNotFound - /// [`ColumnIndexOutOfBounds`]: crate::Error::ColumnIndexOutOfBounds + /// [`ColumnDecode`]: Error::ColumnDecode + /// [`ColumnNotFound`]: Error::ColumnNotFound + /// [`ColumnIndexOutOfBounds`]: Error::ColumnIndexOutOfBounds /// fn try_get<'r, T, I>(&'r self, index: I) -> Result where @@ -198,9 +197,9 @@ pub trait Row: private_row::Sealed + Unpin + Send + Sync + 'static { /// * [`ColumnIndexOutOfBounds`] if the `usize` index was greater than the number of columns in the row. /// * [`ColumnDecode`] if the value could not be decoded into the requested type. /// - /// [`ColumnDecode`]: crate::Error::ColumnDecode - /// [`ColumnNotFound`]: crate::Error::ColumnNotFound - /// [`ColumnIndexOutOfBounds`]: crate::Error::ColumnIndexOutOfBounds + /// [`ColumnDecode`]: Error::ColumnDecode + /// [`ColumnNotFound`]: Error::ColumnNotFound + /// [`ColumnIndexOutOfBounds`]: Error::ColumnIndexOutOfBounds /// #[inline] fn try_get_unchecked<'r, T, I>(&'r self, index: I) -> Result @@ -223,8 +222,8 @@ pub trait Row: private_row::Sealed + Unpin + Send + Sync + 'static { /// * [`ColumnNotFound`] if the column by the given name was not found. /// * [`ColumnIndexOutOfBounds`] if the `usize` index was greater than the number of columns in the row. /// - /// [`ColumnNotFound`]: crate::Error::ColumnNotFound - /// [`ColumnIndexOutOfBounds`]: crate::Error::ColumnIndexOutOfBounds + /// [`ColumnNotFound`]: Error::ColumnNotFound + /// [`ColumnIndexOutOfBounds`]: Error::ColumnIndexOutOfBounds /// fn try_get_raw( &self, diff --git a/sqlx-core/src/value.rs b/sqlx-core/src/value.rs index bf9ef6a3..248b80f5 100644 --- a/sqlx-core/src/value.rs +++ b/sqlx-core/src/value.rs @@ -56,7 +56,7 @@ pub trait Value { /// /// * [`Decode`] if the value could not be decoded into the requested type. /// - /// [`Decode`]: crate::Error::Decode + /// [`Decode`]: Error::Decode /// #[inline] fn try_decode<'r, T>(&'r self) -> Result @@ -83,7 +83,7 @@ pub trait Value { /// /// * [`Decode`] if the value could not be decoded into the requested type. /// - /// [`Decode`]: crate::Error::Decode + /// [`Decode`]: Error::Decode /// #[inline] fn try_decode_unchecked<'r, T>(&'r self) -> Result diff --git a/src/macros.rs b/src/macros.rs index 6cb4e635..2d17b82c 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,6 +1,6 @@ /// Statically checked SQL query with `println!()` style syntax. /// -/// This expands to an instance of [QueryAs][crate::QueryAs] that outputs an ad-hoc anonymous struct type, +/// This expands to an instance of [`QueryAs`](sqlx_core::query_as::QueryAs) that outputs an ad-hoc anonymous struct type, /// if the query has output columns, or `()` (unit) otherwise: /// /// ```rust,ignore