mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-07 00:00:12 +02:00
Clean up axum-debug crate (#498)
* Clean up axum-debug crate Mostly just brings the crate more in line with the rest of the crates in the workspace. I've also removed the axum-debug-macros crate since axum-debug only contained one re-export from axum-debug-macros. So we didn't need two crates. Can always bring the "backend" crate back if we need things in axum-debug that aren't proc-macros. * Just testing: This should make CI fail * Misc CI clean up * fix intentional breakage * fix changelog * Remove rustfmt config for now as it gives warnings on stable * Fix paths
This commit is contained in:
+26
-47
@@ -1,63 +1,42 @@
|
||||
[](https://choosealicense.com/licenses/mit/)
|
||||
[](https://crates.io/crates/axum-debug)
|
||||
[](https://docs.rs/axum-debug/)
|
||||
|
||||
# axum-debug
|
||||
|
||||
[](https://github.com/tokio-rs/axum-debug/actions/workflows/CI.yml)
|
||||
[](https://crates.io/crates/axum-debug)
|
||||
[](https://docs.rs/axum-debug)
|
||||
|
||||
This is a debugging crate that provides better error messages for [`axum`]
|
||||
framework.
|
||||
|
||||
[`axum`] is a great framework for developing web applications. But when you
|
||||
make a mistake, error messages can be really complex and long. It can take a
|
||||
long time for you to figure out what is wrong in your code. This crate provides
|
||||
utilities to generate better error messages in case you make a mistake.
|
||||
|
||||
## Usage Example
|
||||
|
||||
Will fail with a better error message:
|
||||
|
||||
```rust
|
||||
use axum::{routing::get, Router};
|
||||
use axum_debug::debug_handler;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let app = Router::new().route("/", get(handler));
|
||||
|
||||
axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
.serve(app.into_make_service())
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[debug_handler]
|
||||
async fn handler() -> bool {
|
||||
false
|
||||
}
|
||||
```
|
||||
|
||||
Error message:
|
||||
|
||||
```
|
||||
error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
|
||||
--> main.rs:xx:23
|
||||
|
|
||||
xx | async fn handler() -> bool {
|
||||
| ^^^^
|
||||
| |
|
||||
| the trait `IntoResponse` is not implemented for `bool`
|
||||
```
|
||||
More information about this crate can be found in the [crate documentation][docs].
|
||||
|
||||
## Safety
|
||||
|
||||
This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust.
|
||||
|
||||
## Performance
|
||||
## Minimum supported Rust version
|
||||
|
||||
Macros in this crate have no effect when using release profile. (eg. `cargo build --release`)
|
||||
axum-handle-error-extract's MSRV is 1.54.
|
||||
|
||||
## Getting Help
|
||||
|
||||
You're also welcome to ask in the [Discord channel][chat] or open an [issue]
|
||||
with your question.
|
||||
|
||||
## Contributing
|
||||
|
||||
:balloon: Thanks for your help improving the project! We are so happy to have
|
||||
you! We have a [contributing guide][contributing] to help you get involved in the
|
||||
`axum` project.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
This project is licensed under the [MIT license][license].
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in `axum` by you, shall be licensed as MIT, without any
|
||||
additional terms or conditions.
|
||||
|
||||
[`axum`]: https://crates.io/crates/axum
|
||||
[docs]: https://docs.rs/axum-debug
|
||||
|
||||
Reference in New Issue
Block a user