summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Platte <jplatte+git@posteo.de>2023-03-10 12:02:11 +0100
committerGitHub <noreply@github.com>2023-03-10 12:02:11 +0100
commitdc480f7b0e2eed98e2467afd4d39f59bbc0564d1 (patch)
treea33e3b951e393dc4cdc17f2c8805a0bb70193a62
parente7eda0e4167596063295457d606eb625436188ab (diff)
Re-integrate examples into the root workspace (#1466)
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
-rw-r--r--.github/workflows/CI.yml39
-rw-r--r--.gitignore4
-rw-r--r--Cargo.toml11
-rw-r--r--deny.toml2
-rw-r--r--examples/Cargo.toml4
-rw-r--r--examples/anyhow-error-response/src/main.rs2
-rw-r--r--examples/chat/src/main.rs2
-rw-r--r--examples/consume-body-in-extractor-or-middleware/src/main.rs2
-rw-r--r--examples/cors/src/main.rs2
-rw-r--r--examples/customize-extractor-error/README.md2
-rw-r--r--examples/customize-extractor-error/src/main.rs2
-rw-r--r--examples/customize-path-rejection/src/main.rs2
-rw-r--r--examples/error-handling-and-dependency-injection/src/main.rs2
-rw-r--r--examples/form/src/main.rs2
-rw-r--r--examples/global-404-handler/src/main.rs2
-rw-r--r--examples/graceful-shutdown/src/main.rs2
-rw-r--r--examples/handle-head-request/src/main.rs2
-rw-r--r--examples/hello-world/src/main.rs2
-rw-r--r--examples/hyper-1-0/src/main.rs2
-rw-r--r--examples/key-value-store/src/main.rs2
-rw-r--r--examples/low-level-rustls/src/main.rs2
-rw-r--r--examples/multipart-form/src/main.rs2
-rw-r--r--examples/parse-body-based-on-content-type/src/main.rs2
-rw-r--r--examples/print-request-response/src/main.rs2
-rw-r--r--examples/prometheus-metrics/src/main.rs2
-rw-r--r--examples/query-params-with-empty-strings/src/main.rs2
-rw-r--r--examples/readme/src/main.rs2
-rw-r--r--examples/rest-grpc-multiplex/src/main.rs2
-rw-r--r--examples/reverse-proxy/src/main.rs2
-rw-r--r--examples/routes-and-handlers-close-together/src/main.rs2
-rw-r--r--examples/sessions/src/main.rs2
-rw-r--r--examples/simple-router-wasm/src/main.rs2
-rw-r--r--examples/sqlx-postgres/src/main.rs2
-rw-r--r--examples/sse/src/main.rs2
-rw-r--r--examples/static-file-server/src/main.rs2
-rw-r--r--examples/stream-to-file/src/main.rs2
-rw-r--r--examples/templates/src/main.rs2
-rw-r--r--examples/tls-rustls/src/main.rs2
-rw-r--r--examples/todos/src/main.rs2
-rw-r--r--examples/tokio-postgres/src/main.rs2
-rw-r--r--examples/tracing-aka-logging/src/main.rs2
-rw-r--r--examples/unix-domain-socket/src/main.rs2
-rw-r--r--examples/validator/src/main.rs2
-rw-r--r--examples/versioning/src/main.rs2
44 files changed, 60 insertions, 78 deletions
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index 2dbafcdc..8038fe09 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -13,15 +13,9 @@ on:
jobs:
check:
runs-on: ubuntu-latest
- strategy:
- matrix:
- pwd:
- - .
- - examples
steps:
- uses: actions/checkout@master
- uses: arduino/setup-protoc@v1
- if: matrix.pwd == 'examples'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
@@ -31,17 +25,16 @@ jobs:
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- with:
- key: ${{ matrix.pwd }}
- workspaces: ${{ matrix.pwd }}
- name: Check
- working-directory: ${{ matrix.pwd }}
- run: |
- cargo clippy --all --all-targets --all-features
+ uses: actions-rs/cargo@v1
+ with:
+ command: clippy
+ args: --workspace --all-targets --all-features
- name: rustfmt
- working-directory: ${{ matrix.pwd }}
- run: |
- cargo fmt --all -- --check
+ uses: actions-rs/cargo@v1
+ with:
+ command: fmt
+ args: -- --check
check-docs:
runs-on: ubuntu-latest
@@ -62,6 +55,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
+ - uses: arduino/setup-protoc@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
@@ -101,6 +95,7 @@ jobs:
rust: [stable, beta]
steps:
- uses: actions/checkout@master
+ - uses: arduino/setup-protoc@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
@@ -113,6 +108,7 @@ jobs:
command: test
args: --all --all-features --all-targets
+ # some examples doesn't support our MSRV so we only test axum itself on our MSRV
test-nightly:
needs: check
runs-on: ubuntu-latest
@@ -269,11 +265,6 @@ jobs:
dependencies-are-sorted:
runs-on: ubuntu-latest
- strategy:
- matrix:
- pwd:
- - .
- - examples
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
@@ -282,16 +273,12 @@ jobs:
override: true
profile: minimal
- uses: Swatinem/rust-cache@v2
- with:
- key: ${{ matrix.pwd }}
- workspaces: ${{ matrix.pwd }}
- name: Install cargo-sort
run: |
cargo install cargo-sort
+ # Work around cargo-sort not honoring workspace.exclude
- name: Remove non-crate folder
- run: rm -rf async-graphql || true
- working-directory: ${{ matrix.pwd }}
+ run: rm -rf examples/async-graphql
- name: Check dependency tables
- working-directory: ${{ matrix.pwd }}
run: |
cargo sort --workspace --grouped --check
diff --git a/.gitignore b/.gitignore
index b152f4ef..22d9b57e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-/target
-/examples/target
-/examples/*/target
+target
Cargo.lock
.DS_Store
diff --git a/Cargo.toml b/Cargo.toml
index 7853fc3e..a68aaab1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,7 @@
[workspace]
-members = [
- "axum",
- "axum-core",
- "axum-extra",
- "axum-macros",
-]
+members = ["axum", "axum-*", "examples/*"]
+# Only check / build main crates by default (check all with `--workspace`)
+default-members = ["axum", "axum-*"]
+# Example has been deleted, but README.md remains
+exclude = ["examples/async-graphql"]
resolver = "2"
diff --git a/deny.toml b/deny.toml
index de857f36..a53b047b 100644
--- a/deny.toml
+++ b/deny.toml
@@ -21,6 +21,8 @@ skip-tree = [
{ name = "base64" },
# parking_lot pulls in old versions of windows-sys
{ name = "windows-sys" },
+ # old version pulled in by rustls via ring
+ { name = "spin" },
]
[sources]
diff --git a/examples/Cargo.toml b/examples/Cargo.toml
deleted file mode 100644
index 7f7ad93d..00000000
--- a/examples/Cargo.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-[workspace]
-members = ["*"]
-exclude = ["async-graphql", "target"]
-resolver = "2"
diff --git a/examples/anyhow-error-response/src/main.rs b/examples/anyhow-error-response/src/main.rs
index 5116b12f..68548313 100644
--- a/examples/anyhow-error-response/src/main.rs
+++ b/examples/anyhow-error-response/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-anyhow-error-response
+//! cargo run -p example-anyhow-error-response
//! ```
use axum::{
diff --git a/examples/chat/src/main.rs b/examples/chat/src/main.rs
index 458e95fb..3b49c3e8 100644
--- a/examples/chat/src/main.rs
+++ b/examples/chat/src/main.rs
@@ -3,7 +3,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-chat
+//! cargo run -p example-chat
//! ```
use axum::{
diff --git a/examples/consume-body-in-extractor-or-middleware/src/main.rs b/examples/consume-body-in-extractor-or-middleware/src/main.rs
index f8ae4e49..548e4f0e 100644
--- a/examples/consume-body-in-extractor-or-middleware/src/main.rs
+++ b/examples/consume-body-in-extractor-or-middleware/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-consume-body-in-extractor-or-middleware
+//! cargo run -p example-consume-body-in-extractor-or-middleware
//! ```
use axum::{
diff --git a/examples/cors/src/main.rs b/examples/cors/src/main.rs
index a8e02cc5..a0a5e8d8 100644
--- a/examples/cors/src/main.rs
+++ b/examples/cors/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-cors
+//! cargo run -p example-cors
//! ```
use axum::{
diff --git a/examples/customize-extractor-error/README.md b/examples/customize-extractor-error/README.md
index 5c9b8486..bb4eb25f 100644
--- a/examples/customize-extractor-error/README.md
+++ b/examples/customize-extractor-error/README.md
@@ -12,5 +12,5 @@ already existing extractors
Run with
```sh
-cd examples && cargo run -p example-customize-extractor-error
+cargo run -p example-customize-extractor-error
```
diff --git a/examples/customize-extractor-error/src/main.rs b/examples/customize-extractor-error/src/main.rs
index c5359db5..893fbd14 100644
--- a/examples/customize-extractor-error/src/main.rs
+++ b/examples/customize-extractor-error/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-customize-extractor-error
+//! cargo run -p example-customize-extractor-error
//! ```
mod custom_extractor;
diff --git a/examples/customize-path-rejection/src/main.rs b/examples/customize-path-rejection/src/main.rs
index a1cd3866..3bcd91d3 100644
--- a/examples/customize-path-rejection/src/main.rs
+++ b/examples/customize-path-rejection/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-customize-path-rejection
+//! cargo run -p example-customize-path-rejection
//! ```
use axum::{
diff --git a/examples/error-handling-and-dependency-injection/src/main.rs b/examples/error-handling-and-dependency-injection/src/main.rs
index b0964caa..f28ed4ff 100644
--- a/examples/error-handling-and-dependency-injection/src/main.rs
+++ b/examples/error-handling-and-dependency-injection/src/main.rs
@@ -4,7 +4,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-error-handling-and-dependency-injection
+//! cargo run -p example-error-handling-and-dependency-injection
//! ```
use axum::{
diff --git a/examples/form/src/main.rs b/examples/form/src/main.rs
index 233d0cb3..93a5ae13 100644
--- a/examples/form/src/main.rs
+++ b/examples/form/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-form
+//! cargo run -p example-form
//! ```
use axum::{extract::Form, response::Html, routing::get, Router};
diff --git a/examples/global-404-handler/src/main.rs b/examples/global-404-handler/src/main.rs
index eeacb61e..8eb14691 100644
--- a/examples/global-404-handler/src/main.rs
+++ b/examples/global-404-handler/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-global-404-handler
+//! cargo run -p example-global-404-handler
//! ```
use axum::{
diff --git a/examples/graceful-shutdown/src/main.rs b/examples/graceful-shutdown/src/main.rs
index f4a0fc29..3704889a 100644
--- a/examples/graceful-shutdown/src/main.rs
+++ b/examples/graceful-shutdown/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-graceful-shutdown
+//! cargo run -p example-graceful-shutdown
//! kill or ctrl-c
//! ```
diff --git a/examples/handle-head-request/src/main.rs b/examples/handle-head-request/src/main.rs
index 492d3425..5b0db264 100644
--- a/examples/handle-head-request/src/main.rs
+++ b/examples/handle-head-request/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-handle-head-request
+//! cargo run -p example-handle-head-request
//! ```
use axum::response::{IntoResponse, Response};
diff --git a/examples/hello-world/src/main.rs b/examples/hello-world/src/main.rs
index ed115f6b..466caceb 100644
--- a/examples/hello-world/src/main.rs
+++ b/examples/hello-world/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-hello-world
+//! cargo run -p example-hello-world
//! ```
use axum::{response::Html, routing::get, Router};
diff --git a/examples/hyper-1-0/src/main.rs b/examples/hyper-1-0/src/main.rs
index 690b5e37..72c651cc 100644
--- a/examples/hyper-1-0/src/main.rs
+++ b/examples/hyper-1-0/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-hyper-1-0
+//! cargo run -p example-hyper-1-0
//! ```
use axum::{routing::get, Router};
diff --git a/examples/key-value-store/src/main.rs b/examples/key-value-store/src/main.rs
index 0a751df4..ccf21825 100644
--- a/examples/key-value-store/src/main.rs
+++ b/examples/key-value-store/src/main.rs
@@ -3,7 +3,7 @@
//! Run with:
//!
//! ```not_rust
-//! cd examples && cargo run -p example-key-value-store
+//! cargo run -p example-key-value-store
//! ```
use axum::{
diff --git a/examples/low-level-rustls/src/main.rs b/examples/low-level-rustls/src/main.rs
index 16de3ac1..22176844 100644
--- a/examples/low-level-rustls/src/main.rs
+++ b/examples/low-level-rustls/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-low-level-rustls
+//! cargo run -p example-low-level-rustls
//! ```
use axum::{extract::ConnectInfo, routing::get, Router};
diff --git a/examples/multipart-form/src/main.rs b/examples/multipart-form/src/main.rs
index ee881d28..31f2887e 100644
--- a/examples/multipart-form/src/main.rs
+++ b/examples/multipart-form/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-multipart-form
+//! cargo run -p example-multipart-form
//! ```
use axum::{
diff --git a/examples/parse-body-based-on-content-type/src/main.rs b/examples/parse-body-based-on-content-type/src/main.rs
index 2e1222a7..01762238 100644
--- a/examples/parse-body-based-on-content-type/src/main.rs
+++ b/examples/parse-body-based-on-content-type/src/main.rs
@@ -3,7 +3,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-parse-body-based-on-content-type
+//! cargo run -p example-parse-body-based-on-content-type
//! ```
use axum::{
diff --git a/examples/print-request-response/src/main.rs b/examples/print-request-response/src/main.rs
index 7fa568f8..c071ff54 100644
--- a/examples/print-request-response/src/main.rs
+++ b/examples/print-request-response/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-print-request-response
+//! cargo run -p example-print-request-response
//! ```
use axum::{
diff --git a/examples/prometheus-metrics/src/main.rs b/examples/prometheus-metrics/src/main.rs
index e02bf735..cf7db5ac 100644
--- a/examples/prometheus-metrics/src/main.rs
+++ b/examples/prometheus-metrics/src/main.rs
@@ -4,7 +4,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-prometheus-metrics
+//! cargo run -p example-prometheus-metrics
//! ```
use axum::{
diff --git a/examples/query-params-with-empty-strings/src/main.rs b/examples/query-params-with-empty-strings/src/main.rs
index 0af20111..aa424643 100644
--- a/examples/query-params-with-empty-strings/src/main.rs
+++ b/examples/query-params-with-empty-strings/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-query-params-with-empty-strings
+//! cargo run -p example-query-params-with-empty-strings
//! ```
use axum::{extract::Query, routing::get, Router};
diff --git a/examples/readme/src/main.rs b/examples/readme/src/main.rs
index a606893d..bdcb8945 100644
--- a/examples/readme/src/main.rs
+++ b/examples/readme/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-readme
+//! cargo run -p example-readme
//! ```
use axum::{
diff --git a/examples/rest-grpc-multiplex/src/main.rs b/examples/rest-grpc-multiplex/src/main.rs
index 4e03a565..bd4ce0d9 100644
--- a/examples/rest-grpc-multiplex/src/main.rs
+++ b/examples/rest-grpc-multiplex/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-rest-grpc-multiplex
+//! cargo run -p example-rest-grpc-multiplex
//! ```
use self::multiplex_service::MultiplexService;
diff --git a/examples/reverse-proxy/src/main.rs b/examples/reverse-proxy/src/main.rs
index d8cabb79..d97dcf44 100644
--- a/examples/reverse-proxy/src/main.rs
+++ b/examples/reverse-proxy/src/main.rs
@@ -4,7 +4,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-reverse-proxy
+//! cargo run -p example-reverse-proxy
//! ```
use axum::{
diff --git a/examples/routes-and-handlers-close-together/src/main.rs b/examples/routes-and-handlers-close-together/src/main.rs
index 41aaa49d..75320d09 100644
--- a/examples/routes-and-handlers-close-together/src/main.rs
+++ b/examples/routes-and-handlers-close-together/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-routes-and-handlers-close-together
+//! cargo run -p example-routes-and-handlers-close-together
//! ```
use axum::{
diff --git a/examples/sessions/src/main.rs b/examples/sessions/src/main.rs
index a325b288..9bea9c1b 100644
--- a/examples/sessions/src/main.rs
+++ b/examples/sessions/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-sessions
+//! cargo run -p example-sessions
//! ```
use async_session::{MemoryStore, Session, SessionStore as _};
diff --git a/examples/simple-router-wasm/src/main.rs b/examples/simple-router-wasm/src/main.rs
index 5f82109e..d5c9b3bd 100644
--- a/examples/simple-router-wasm/src/main.rs
+++ b/examples/simple-router-wasm/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-simple-router-wasm
+//! cargo run -p example-simple-router-wasm
//! ```
//!
//! This example shows what using axum in a wasm context might look like. This example should
diff --git a/examples/sqlx-postgres/src/main.rs b/examples/sqlx-postgres/src/main.rs
index 8110ab2a..8e3353b9 100644
--- a/examples/sqlx-postgres/src/main.rs
+++ b/examples/sqlx-postgres/src/main.rs
@@ -3,7 +3,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-sqlx-postgres
+//! cargo run -p example-sqlx-postgres
//! ```
//!
//! Test with curl:
diff --git a/examples/sse/src/main.rs b/examples/sse/src/main.rs
index 6132f4fa..dab5a565 100644
--- a/examples/sse/src/main.rs
+++ b/examples/sse/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-sse
+//! cargo run -p example-sse
//! ```
use axum::{
diff --git a/examples/static-file-server/src/main.rs b/examples/static-file-server/src/main.rs
index 00aa3a54..d1eac21f 100644
--- a/examples/static-file-server/src/main.rs
+++ b/examples/static-file-server/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples/static-file-server && cargo run -p example-static-file-server
+//! cargo run -p example-static-file-server
//! ```
use axum::{
diff --git a/examples/stream-to-file/src/main.rs b/examples/stream-to-file/src/main.rs
index 38e88eff..585ad3de 100644
--- a/examples/stream-to-file/src/main.rs
+++ b/examples/stream-to-file/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-stream-to-file
+//! cargo run -p example-stream-to-file
//! ```
use axum::{
diff --git a/examples/templates/src/main.rs b/examples/templates/src/main.rs
index c23215be..d7e01a94 100644
--- a/examples/templates/src/main.rs
+++ b/examples/templates/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-templates
+//! cargo run -p example-templates
//! ```
use askama::Template;
diff --git a/examples/tls-rustls/src/main.rs b/examples/tls-rustls/src/main.rs
index e73f425f..5034cf31 100644
--- a/examples/tls-rustls/src/main.rs
+++ b/examples/tls-rustls/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-tls-rustls
+//! cargo run -p example-tls-rustls
//! ```
use axum::{
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 7576d186..4463bfa4 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -10,7 +10,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-todos
+//! cargo run -p example-todos
//! ```
use axum::{
diff --git a/examples/tokio-postgres/src/main.rs b/examples/tokio-postgres/src/main.rs
index 33c703ca..77c4c112 100644
--- a/examples/tokio-postgres/src/main.rs
+++ b/examples/tokio-postgres/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-tokio-postgres
+//! cargo run -p example-tokio-postgres
//! ```
use axum::{
diff --git a/examples/tracing-aka-logging/src/main.rs b/examples/tracing-aka-logging/src/main.rs
index a075f46b..38093066 100644
--- a/examples/tracing-aka-logging/src/main.rs
+++ b/examples/tracing-aka-logging/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-tracing-aka-logging
+//! cargo run -p example-tracing-aka-logging
//! ```
use axum::{
diff --git a/examples/unix-domain-socket/src/main.rs b/examples/unix-domain-socket/src/main.rs
index df28bbb0..0a3d3f0d 100644
--- a/examples/unix-domain-socket/src/main.rs
+++ b/examples/unix-domain-socket/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-unix-domain-socket
+//! cargo run -p example-unix-domain-socket
//! ```
#[cfg(unix)]
diff --git a/examples/validator/src/main.rs b/examples/validator/src/main.rs
index 692ee801..ecfe9509 100644
--- a/examples/validator/src/main.rs
+++ b/examples/validator/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-validator
+//! cargo run -p example-validator
//!
//! curl '127.0.0.1:3000?name='
//! -> Input validation error: [name: Can not be empty]
diff --git a/examples/versioning/src/main.rs b/examples/versioning/src/main.rs
index 8849b64e..fd3f6668 100644
--- a/examples/versioning/src/main.rs
+++ b/examples/versioning/src/main.rs
@@ -1,7 +1,7 @@
//! Run with
//!
//! ```not_rust
-//! cd examples && cargo run -p example-versioning
+//! cargo run -p example-versioning
//! ```
use axum::{