From d10b71fe0699146f20a75cf5675f59cbd11a9252 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 7 Aug 2024 01:03:40 +0100 Subject: [PATCH] docs(session): doc adding features using cargo add --- actix-session/README.md | 24 ++++++++---------------- justfile | 10 ++++++++-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/actix-session/README.md b/actix-session/README.md index 6a0a1cf4d..8bbdd3af7 100644 --- a/actix-session/README.md +++ b/actix-session/README.md @@ -94,34 +94,26 @@ By default, `actix-session` does not provide any storage backend to retrieve and - a purely cookie-based "backend", [`CookieSessionStore`], using the `cookie-session` feature flag. - ```toml - [dependencies] - # ... - actix-session = { version = "...", features = ["cookie-session"] } + ```console + cargo add actix-session --features=cookie-session ``` - a Redis-based backend via the [`redis`] crate, [`RedisSessionStore`], using the `redis-session` feature flag. - ```toml - [dependencies] - # ... - actix-session = { version = "...", features = ["redis-session"] } + ```console + cargo add actix-session --features=redis-session ``` Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secure connection (via the `native-tls` crate): - ```toml - [dependencies] - # ... - actix-session = { version = "...", features = ["redis-session-native-tls"] } + ```console + cargo add actix-session --features=redis-session-native-tls ``` If you, instead, prefer depending on `rustls`, use the `redis-session-rustls` feature flag: - ```toml - [dependencies] - # ... - actix-session = { version = "...", features = ["redis-session-rustls"] } + ```console + cargo add actix-session --features=redis-session-rustls ``` You can implement your own session storage backend using the [`SessionStore`] trait. diff --git a/justfile b/justfile index 11625b5f9..c4f538679 100644 --- a/justfile +++ b/justfile @@ -19,11 +19,17 @@ msrv_rustup := "+" + msrv clippy: cargo {{ toolchain }} clippy --workspace --all-targets --all-features -# Format workspace. +# Format project. [group("lint")] fmt: update-readmes cargo +nightly fmt - fd --hidden --extension=yml --extension=md --exec-batch npx -y prettier --write + fd --type=file --hidden --extension=yml --extension=md --exec-batch npx -y prettier --write + +# Check project. +[group("lint")] +check: + cargo +nightly fmt -- --check + fd --type=file --hidden --extension=yml --extension=md --exec-batch npx -y prettier --check # Update READMEs from crate root documentation. [group("lint")]