News for hackers. Stuff that matters.
Re:24 days of Rust – serde by EugeneOZ on Thursday December 08, 2016 @07:45PM (#13135758)
for silent downvoter: this line "Next create a file src/serde_types.in.rs to hold all the types for which we need code generation." sounds ridiculous for web projects with hundreds of entities, needed to be transferred as json objects trough API.
Re:24 days of Rust – serde by cptroot on Thursday December 08, 2016 @10:01PM (#13136342)
For what it's worth, you only need one file to be included. Any other files will be included and translated as necessary, so the only file that needs the .in extension is the root of the serde types.
Re:24 days of Rust – serde by EugeneOZ on Friday December 09, 2016 @02:18AM (#13137261)
Doesn't matter. Duplication of hundreds of structs is a nightmare when you want to change some fields.
Re:24 days of Rust – serde by erickt on Monday December 12, 2016 @12:23PM (#13159801)
There's no real difference with what serde_codegen does, and what the compiler does for expanding macros. It's just expanding to source rather than raw AST.

The idea would be that these types would be put into a library (or just another module) that's used by the rest of the app. There wouldn't be duplication of these structures. It's not ideal, which is why we are working on stabilizing the compiler features to do away from codegen.

Re:24 days of Rust – serde by ibotty on Sunday December 11, 2016 @04:20AM (#13150293)
Why do you think you need duplication of hundreds of structs?