chore (backend-rs, macro-rs): fix comment style

This commit is contained in:
naskya 2024-06-01 02:23:58 +09:00
parent 3407e4b395
commit 23c8636129
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 19 additions and 19 deletions

View file

@ -50,9 +50,9 @@ fn wildcard(category: Category) -> String {
///
/// # Arguments
///
/// - `key` : key (prefixed automatically)
/// - `value` : (de)serializable value
/// - `expire_seconds` : TTL
/// * `key` : key (prefixed automatically)
/// * `value` : (de)serializable value
/// * `expire_seconds` : TTL
///
/// # Example
///
@ -96,7 +96,7 @@ pub async fn set<V: for<'a> Deserialize<'a> + Serialize>(
///
/// # Argument
///
/// - `key` : key (will be prefixed automatically)
/// * `key` : key (will be prefixed automatically)
///
/// # Example
///
@ -135,9 +135,9 @@ pub async fn get<V: for<'a> Deserialize<'a> + Serialize>(key: &str) -> Result<Op
///
/// # Argument
///
/// - `key` : key (prefixed automatically)
/// * `key` : key (prefixed automatically)
///
/// ## Example
/// # Example
///
/// ```
/// # use backend_rs::database::cache;
@ -169,10 +169,10 @@ pub async fn delete(key: &str) -> Result<(), Error> {
///
/// # Arguments
///
/// - `category` : one of [Category]
/// - `key` : key (prefixed automatically)
/// - `value` : (de)serializable value
/// - `expire_seconds` : TTL
/// * `category` : one of [Category]
/// * `key` : key (prefixed automatically)
/// * `value` : (de)serializable value
/// * `expire_seconds` : TTL
pub async fn set_one<V: for<'a> Deserialize<'a> + Serialize>(
category: Category,
key: &str,
@ -188,8 +188,8 @@ pub async fn set_one<V: for<'a> Deserialize<'a> + Serialize>(
///
/// # Arguments
///
/// - `category` : one of [Category]
/// - `key` : key (prefixed automatically)
/// * `category` : one of [Category]
/// * `key` : key (prefixed automatically)
pub async fn get_one<V: for<'a> Deserialize<'a> + Serialize>(
category: Category,
key: &str,
@ -213,7 +213,7 @@ pub async fn delete_one(category: Category, key: &str) -> Result<(), Error> {
///
/// # Argument
///
/// - `category` : one of [Category]
/// * `category` : one of [Category]
pub async fn delete_all(category: Category) -> Result<(), Error> {
let mut redis = redis_conn().await?;
let keys: Vec<Vec<u8>> = redis.keys(wildcard(category)).await?;

View file

@ -25,7 +25,7 @@ pub fn read_version_from_package_json(_item: proc_macro::TokenStream) -> proc_ma
quote! { #version }.into()
}
/// Export this function, struct, enum, const, etc. to TypeScript.
/// Export a function, struct, enum, const, etc. to TypeScript.
///
/// This is a wrapper of [macro@napi] that expands to
/// ```no_run
@ -48,7 +48,7 @@ pub fn export(
.into()
}
/// Export this function, struct, enum, const, etc. to TypeScript
/// Export a function, struct, enum, const, etc. to TypeScript
/// and make it unable to use in Rust.
///
/// This is a wrapper of [macro@napi] that expands to
@ -84,13 +84,13 @@ pub fn ts_export(
/// - `js_name` to the camelCase version of the original function name (for functions)
///
/// The types of the function arguments is converted with following rules:
/// - `&str` and `&mut str` are converted to `String`
/// - `&[T]` and `&mut [T]` are converted to `Vec<T>`
/// - `&str` and `&mut str` are converted to [`String`]
/// - `&[T]` and `&mut [T]` are converted to [`Vec<T>`]
/// - `&T` and `&mut T` are converted to `T`
/// - Other `T` remains `T`
///
/// In addition, return type `Result<T>` and `Result<T, E>` are converted to `napi::Result<T>`.
/// Note that `E` must implement `std::string::ToString` trait.
/// In addition, return type [`Result<T>`] and [`Result<T, E>`] are converted to [`napi::Result<T>`](https://docs.rs/napi/latest/napi/type.Result.html).
/// Note that `E` must implement [`std::string::ToString`] trait.
///
/// # Examples
/// ## Applying the macro to a struct