Skip to content

Commit aee2c89

Browse files
committed
Re-integrate examples with the main workspace
… as non-default members. This reverts commit 1fe4558.
1 parent 63a6d4c commit aee2c89

File tree

37 files changed

+47
-57
lines changed

37 files changed

+47
-57
lines changed

.github/workflows/CI.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ on:
1313
jobs:
1414
check:
1515
runs-on: ubuntu-latest
16-
strategy:
17-
matrix:
18-
pwd:
19-
- .
20-
- examples
2116
steps:
2217
- uses: actions/checkout@master
2318
- uses: actions-rs/toolchain@v1
@@ -31,13 +26,15 @@ jobs:
3126
key: ${{ matrix.pwd }}
3227
workspaces: ${{ matrix.pwd }}
3328
- name: Check
34-
working-directory: ${{ matrix.pwd }}
35-
run: |
36-
cargo clippy --all --all-targets --all-features
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: clippy
32+
args: --workspace --all-targets --all-features
3733
- name: rustfmt
38-
working-directory: ${{ matrix.pwd }}
39-
run: |
40-
cargo fmt --all -- --check
34+
uses: actions-rs/cargo@v1
35+
with:
36+
command: fmt
37+
args: -- --check
4138

4239
check-docs:
4340
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/target
2-
/examples/target
3-
/examples/*/target
1+
target
42
Cargo.lock
53
.DS_Store

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[workspace]
2-
members = [
3-
"axum",
4-
"axum-core",
5-
"axum-extra",
6-
"axum-macros",
7-
]
2+
members = ["axum", "axum-*", "examples/*"]
3+
# Only check / build main crates by default (check all with `--workspace`)
4+
default-members = ["axum", "axum-*"]
5+
# Example has been deleted, but README.md remains
6+
exclude = ["examples/async-graphql"]
87
resolver = "2"

examples/Cargo.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/chat/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Run with
44
//!
55
//! ```not_rust
6-
//! cd examples && cargo run -p example-chat
6+
//! cargo run -p example-chat
77
//! ```
88
99
use axum::{

examples/consume-body-in-extractor-or-middleware/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-consume-body-in-extractor-or-middleware
4+
//! cargo run -p example-consume-body-in-extractor-or-middleware
55
//! ```
66
77
use axum::{

examples/cors/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-cors
4+
//! cargo run -p example-cors
55
//! ```
66
77
use axum::{

examples/customize-extractor-error/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-customize-extractor-error
4+
//! cargo run -p example-customize-extractor-error
55
//! ```
66
77
mod custom_extractor;

examples/customize-path-rejection/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-customize-path-rejection
4+
//! cargo run -p example-customize-path-rejection
55
//! ```
66
77
use axum::{

examples/error-handling-and-dependency-injection/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! Run with
55
//!
66
//! ```not_rust
7-
//! cd examples && cargo run -p example-error-handling-and-dependency-injection
7+
//! cargo run -p example-error-handling-and-dependency-injection
88
//! ```
99
1010
use axum::{

examples/form/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-form
4+
//! cargo run -p example-form
55
//! ```
66
77
use axum::{extract::Form, response::Html, routing::get, Router};

examples/global-404-handler/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-global-404-handler
4+
//! cargo run -p example-global-404-handler
55
//! ```
66
77
use axum::{

examples/graceful-shutdown/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-graceful-shutdown
4+
//! cargo run -p example-graceful-shutdown
55
//! kill or ctrl-c
66
//! ```
77

examples/hello-world/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-hello-world
4+
//! cargo run -p example-hello-world
55
//! ```
66
77
use axum::{response::Html, routing::get, Router};

examples/key-value-store/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Run with:
44
//!
55
//! ```not_rust
6-
//! cd examples && cargo run -p example-key-value-store
6+
//! cargo run -p example-key-value-store
77
//! ```
88
99
use axum::{

examples/low-level-rustls/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-low-level-rustls
4+
//! cargo run -p example-low-level-rustls
55
//! ```
66
77
use axum::{extract::ConnectInfo, routing::get, Router};

examples/multipart-form/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-multipart-form
4+
//! cargo run -p example-multipart-form
55
//! ```
66
77
use axum::{

examples/print-request-response/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-print-request-response
4+
//! cargo run -p example-print-request-response
55
//! ```
66
77
use axum::{

examples/prometheus-metrics/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! Run with
55
//!
66
//! ```not_rust
7-
//! cd examples && cargo run -p example-prometheus-metrics
7+
//! cargo run -p example-prometheus-metrics
88
//! ```
99
1010
use axum::{

examples/query-params-with-empty-strings/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-query-params-with-empty-strings
4+
//! cargo run -p example-query-params-with-empty-strings
55
//! ```
66
77
use axum::{extract::Query, routing::get, Router};

examples/readme/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-readme
4+
//! cargo run -p example-readme
55
//! ```
66
77
use axum::{

examples/reverse-proxy/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! Run with
55
//!
66
//! ```not_rust
7-
//! cd examples && cargo run -p example-reverse-proxy
7+
//! cargo run -p example-reverse-proxy
88
//! ```
99
1010
use axum::{

examples/routes-and-handlers-close-together/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-routes-and-handlers-close-together
4+
//! cargo run -p example-routes-and-handlers-close-together
55
//! ```
66
77
use axum::{

examples/sessions/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-sessions
4+
//! cargo run -p example-sessions
55
//! ```
66
77
use async_session::{MemoryStore, Session, SessionStore as _};

examples/sqlx-postgres/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Run with
44
//!
55
//! ```not_rust
6-
//! cd examples && cargo run -p example-sqlx-postgres
6+
//! cargo run -p example-sqlx-postgres
77
//! ```
88
//!
99
//! Test with curl:

examples/sse/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-sse
4+
//! cargo run -p example-sse
55
//! ```
66
77
use axum::{

examples/static-file-server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-static-file-server
4+
//! cargo run -p example-static-file-server
55
//! ```
66
77
use axum::{

examples/stream-to-file/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-stream-to-file
4+
//! cargo run -p example-stream-to-file
55
//! ```
66
77
use axum::{

examples/templates/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-templates
4+
//! cargo run -p example-templates
55
//! ```
66
77
use askama::Template;

examples/tls-rustls/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-tls-rustls
4+
//! cargo run -p example-tls-rustls
55
//! ```
66
77
use axum::{

examples/todos/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! Run with
1111
//!
1212
//! ```not_rust
13-
//! cd examples && cargo run -p example-todos
13+
//! cargo run -p example-todos
1414
//! ```
1515
1616
use axum::{

examples/tokio-postgres/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-tokio-postgres
4+
//! cargo run -p example-tokio-postgres
55
//! ```
66
77
use axum::{

examples/tracing-aka-logging/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-tracing-aka-logging
4+
//! cargo run -p example-tracing-aka-logging
55
//! ```
66
77
use axum::{

examples/unix-domain-socket/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-unix-domain-socket
4+
//! cargo run -p example-unix-domain-socket
55
//! ```
66
77
#[cfg(unix)]

examples/validator/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-validator
4+
//! cargo run -p example-validator
55
//!
66
//! curl '127.0.0.1:3000?name='
77
//! -> Input validation error: [name: Can not be empty]

examples/versioning/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Run with
22
//!
33
//! ```not_rust
4-
//! cd examples && cargo run -p example-versioning
4+
//! cargo run -p example-versioning
55
//! ```
66
77
use axum::{

examples/websockets/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Run with
44
//!
55
//! ```not_rust
6-
//! cd examples && cargo run -p example-websockets
6+
//! cargo run -p example-websockets
77
//! ```
88
99
use axum::{

0 commit comments

Comments
 (0)