From 20d91554673c81c0aa894927652dbc8d9d92a70f Mon Sep 17 00:00:00 2001 From: Michael Bachmann Date: Mon, 6 May 2024 16:47:33 +0200 Subject: [PATCH] diesel_derives: specify `derive_from_sql_row()` docs This change addresses a terminology detail that may slightly mislead some library users. The current doc comment states that this derive implements `Queryable` for primitive types. "Primitive type" in that context is supposed to refer to a rust type that corresponds to a single SQL type in contrast to a whole database row. However, the current term unfortunately collides with Rust's definition of "primitive types" [1] so we phrase it in a slightly more elaborate way to prevent confusion. [1] https://doc.rust-lang.org/rust-by-example/primitives.html --- diesel_derives/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diesel_derives/src/lib.rs b/diesel_derives/src/lib.rs index 4d049d18434f..2a803bd52dbf 100644 --- a/diesel_derives/src/lib.rs +++ b/diesel_derives/src/lib.rs @@ -218,7 +218,7 @@ pub fn derive_diesel_numeric_ops(input: TokenStream) -> TokenStream { diesel_numeric_ops::derive(parse_macro_input!(input)).into() } -/// Implements `Queryable` for primitive types +/// Implements `Queryable` for types that correspond to a single SQL type. The type must implement `FromSql`. /// /// This derive is mostly useful to implement support deserializing /// into rust types not supported by Diesel itself.