Open
Description
Looking at the examples in the examples
folder I see that many don't come with tests.
Having tests with the examples will both help make sure that they stay correct as axum changes and it will help the would be developers to learn how to test.
As I see many of the examples have
async fn main() {
...
let app = Router::new()
...
}
This, as far as I understand, makes it impossible to use the router in the tests. So I think it would be a good idea to refactor these examples to defined a function
fn app() -> Router {
}
and then write
async fn main() {
...
let app: Router = app();
...
}
I'd be happy to do this work for some of the examples, but I'd like to know if you even consider this a good idea.
Metadata
Metadata
Assignees
Labels
No labels