Closed saiumesh535 closed 3 years ago
Code looks great -- what do you think about...
Serialize
from serde rather than just a stringhttps://docs.serde.rs/serde_json/ser/fn.to_vec.html
to prevent struct -> string -> vec and just going struct -> vecJust a thought, feel free to push back. Seems like it would be nice though to be able to just pass context.json(MySerializableStruct {})
though!
Code looks great -- what do you think about...
* Requiring the argument to be `Serialize` from serde rather than just a string * Calling `https://docs.serde.rs/serde_json/ser/fn.to_vec.html` to prevent struct -> string -> vec and just going struct -> vec * Putting this behind a feature flag so we don't always require serde/serde_json
Just a thought, feel free to push back. Seems like it would be nice though to be able to just pass
context.json(MySerializableStruct {})
though!
Hey. I think it's a good ides and I added now. let me know if I'm missing something. Thanks
Perfect! I didn't realize that the serde packages weren't optional already, so that's another thing for me to do later. Great addition though!!
Added json and set_status methods in BasicContext. This is similar to one in express as