Conn methods + feedback on conn macros #48
Replies: 3 comments 3 replies
-
Hope it doesn't come across as nit-picking, just wanted to give some general feedback after some usage. I'm not entirely sure about the future direction so that's why I've not created any issues :) |
Beta Was this translation helpful? Give feedback.
-
I assume you're using * routes? What is the case for using * but wanting the full path?
Yes, that's an outstanding issue. I haven't added query or hash accessors yet.
This isn't how I imagined these macros being used — I was figuring the first argument would always be short, probably always let user = match db.users.get(uuid.as_bytes) {
Ok(user) => user,
Err(_) => {
return handle_db_error(conn);
}
}
// elsewhere
fn handle_db_error(conn: Conn) -> Conn {
conn.with_body("failed to access db")
.with_status(500)
.halt()
} |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I think the other way around is much easier to read.
Beta Was this translation helpful? Give feedback.
All reactions