Skip to content

Commit 2910227

Browse files
committed
chore: remove cargo-sync-readme
1 parent 8c8beae commit 2910227

3 files changed

Lines changed: 2 additions & 88 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,3 @@ jobs:
112112

113113
- name: Check unused Cargo dependencies
114114
run: cargo shear
115-
116-
readme:
117-
runs-on: ubuntu-latest
118-
steps:
119-
- uses: actions/checkout@v2
120-
- uses: actions-rs/toolchain@v1
121-
with:
122-
toolchain: stable
123-
124-
- name: Install `cargo-sync-readme`
125-
uses: actions-rs/install@v0.1
126-
with:
127-
crate: cargo-sync-readme
128-
version: latest
129-
130-
- name: Is readme in sync?
131-
run: cargo sync-readme -c

README.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
# tower-cookies
66

7-
<!-- cargo-sync-readme start -->
8-
97
A cookie manager middleware built on top of [tower].
108

119
## Example
@@ -43,43 +41,14 @@ A complete CRUD cookie example in [examples/counter.rs][example]
4341
[tower]: https://crates.io/crates/tower
4442
[example]: https://github.com/imbolc/tower-cookies/blob/main/examples/counter.rs
4543

46-
<!-- cargo-sync-readme end -->
47-
48-
## Safety
49-
50-
This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in
51-
100% safe Rust.
52-
5344
## Contributing
5445

5546
Please run [.pre-commit.sh] before sending a PR, it will check everything.
5647

57-
### Note on README
58-
59-
Most of the readme is automatically copied from the crate documentation by
60-
[cargo-sync-readme][]. This way the readme is always in sync with the docs and
61-
examples are tested.
62-
63-
So if you find a part of the readme you'd like to change between
64-
`<!-- cargo-sync-readme start -->` and `<!-- cargo-sync-readme end -->` markers,
65-
don't edit `README.md` directly, but rather change the documentation on top of
66-
`src/lib.rs` and then synchronize the readme with:
67-
68-
```bash
69-
cargo sync-readme
70-
```
71-
72-
(make sure the cargo command is installed):
73-
74-
```bash
75-
cargo install cargo-sync-readme
76-
```
77-
7848
## License
7949

8050
This project is licensed under the [MIT license][license].
8151

8252
[.pre-commit.sh]:
8353
https://github.com/imbolc/tower-cookies/blob/main/.pre-commit.sh
84-
[cargo-sync-readme]: https://github.com/phaazon/cargo-sync-readme
8554
[license]: https://github.com/imbolc/tower-cookies/blob/main/LICENSE

src/lib.rs

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,5 @@
1-
//! A cookie manager middleware built on top of [tower].
2-
//!
3-
//! ## Example
4-
//!
5-
//! With [axum]:
6-
//!
7-
//! ```rust,no_run
8-
//! use axum::{routing::get, Router};
9-
//! use std::net::SocketAddr;
10-
//! use tower_cookies::{Cookie, CookieManagerLayer, Cookies};
11-
//!
12-
//! # #[cfg(feature = "axum-core")]
13-
//! #[tokio::main]
14-
//! async fn main() {
15-
//! let app = Router::new()
16-
//! .route("/", get(handler))
17-
//! .layer(CookieManagerLayer::new());
18-
//!
19-
//! let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
20-
//! let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
21-
//! axum::serve(listener, app.into_make_service())
22-
//! .await
23-
//! .unwrap();
24-
//! }
25-
//! # #[cfg(not(feature = "axum-core"))]
26-
//! # fn main() {}
27-
//!
28-
//! async fn handler(cookies: Cookies) -> &'static str {
29-
//! cookies.add(Cookie::new("hello_world", "hello_world"));
30-
//!
31-
//! "Check your cookies."
32-
//! }
33-
//! ```
34-
//!
35-
//! A complete CRUD cookie example in [examples/counter.rs][example]
36-
//!
37-
//! [axum]: https://crates.io/crates/axum
38-
//! [tower]: https://crates.io/crates/tower
39-
//! [example]: https://github.com/imbolc/tower-cookies/blob/main/examples/counter.rs
40-
1+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2+
#![doc = include_str!("../README.md")]
413
#![warn(clippy::all, missing_docs, nonstandard_style, future_incompatible)]
424
#![forbid(unsafe_code)]
435
#![cfg_attr(docsrs, feature(doc_cfg))]

0 commit comments

Comments
 (0)