mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 11:12:58 +00:00
docs: fix 'cargo doc' warnings
`cargo doc --workspace --no-deps` reported many rustdoc warnings. Fix them without changing what any comment says: - Wrap bare URLs in `<` and `>` so rustdoc renders them as links. - Drop explicit link targets that only repeat the link text. - Point intra-doc links at the item's real path, or write names that rustdoc cannot resolve as plain code text. - Escape `<` and `>` that are not HTML tags. - Add the braces rustdoc needs to parse the example code blocks. Tests: cargo doc --workspace --no-deps reports no rustdoc warnings Co-authored-by: Pekka Enberg <penberg@iki.fi>
This commit is contained in:
committed by
Pekka Enberg
parent
fcb6d7239d
commit
8dd0caac4e
@@ -310,20 +310,18 @@ pub fn register_extension(input: TokenStream) -> TokenStream {
|
||||
/// use turso_ext::{scalar, Value};
|
||||
/// #[scalar(name = "double", alias = "twice")] // you can provide an <optional> alias
|
||||
/// fn double(args: &[Value]) -> Value {
|
||||
/// let arg = args.get(0).unwrap();
|
||||
/// match arg.value_type() {
|
||||
/// ValueType::Float => {
|
||||
/// let val = arg.to_float().unwrap();
|
||||
/// Value::from_float(val * 2.0)
|
||||
/// }
|
||||
/// ValueType::Integer => {
|
||||
/// let val = arg.to_integer().unwrap();
|
||||
/// Value::from_integer(val * 2)
|
||||
/// }
|
||||
/// }
|
||||
/// } else {
|
||||
/// Value::null()
|
||||
/// }
|
||||
/// let arg = args.get(0).unwrap();
|
||||
/// match arg.value_type() {
|
||||
/// ValueType::Float => {
|
||||
/// let val = arg.to_float().unwrap();
|
||||
/// Value::from_float(val * 2.0)
|
||||
/// }
|
||||
/// ValueType::Integer => {
|
||||
/// let val = arg.to_integer().unwrap();
|
||||
/// Value::from_integer(val * 2)
|
||||
/// }
|
||||
/// _ => Value::null(),
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
#[proc_macro_attribute]
|
||||
@@ -523,6 +521,7 @@ pub fn derive_vtab_module(input: TokenStream) -> TokenStream {
|
||||
///
|
||||
/// struct ExampleFile {
|
||||
/// file: std::fs::File,
|
||||
/// }
|
||||
///
|
||||
///
|
||||
/// impl VfsExtension for ExampleFS {
|
||||
@@ -562,6 +561,7 @@ pub fn derive_vtab_module(input: TokenStream) -> TokenStream {
|
||||
/// // (optional) method to generate random number. Used for testing
|
||||
/// chrono::Local::now().format("%Y-%m-%d %H:%M:%S").to_string()
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
///
|
||||
/// impl VfsFile for ExampleFile {
|
||||
@@ -597,8 +597,7 @@ pub fn derive_vtab_module(input: TokenStream) -> TokenStream {
|
||||
/// fn size(&self) -> i64 {
|
||||
/// self.file.metadata().map(|m| m.len() as i64).unwrap_or(-1)
|
||||
/// }
|
||||
///}
|
||||
///
|
||||
/// }
|
||||
///```
|
||||
#[proc_macro_derive(VfsDerive)]
|
||||
pub fn derive_vfs_module(input: TokenStream) -> TokenStream {
|
||||
|
||||
Reference in New Issue
Block a user