Write exported files to target/generated/<crate_name>#31
Conversation
Codecov ReportBase: 40.04% // Head: 39.94% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## trunk #31 +/- ##
==========================================
- Coverage 40.04% 39.94% -0.10%
==========================================
Files 19 19
Lines 1878 1860 -18
==========================================
- Hits 752 743 -9
+ Misses 1126 1117 -9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| /// The outputted file is unformatted. Use `cargo fmt -- target/<file>.rs` to format the file. | ||
| pub fn export_to_file(&self, file_postfix: &str) -> bool { | ||
| /// The outputted file is unformatted. Use `cargo fmt -- target/generated/<crate_name>/<file>.rs` to format the file. | ||
| pub fn export_to_file(&self, crate_name: &str, file_postfix: &str) -> bool { |
There was a problem hiding this comment.
It would be nice if we can automatically derive the crate_name ourselves, but I'm not sure if there's a way to do that
There was a problem hiding this comment.
I gave this some thought and tried a couple of experiments, but couldn't come up with anything. :( Seems like it might not be possible without maybe exporting a macro or something that starts getting hacky.
caa3877 to
a680e94
Compare
|
Thanks! |
Unblocks bincode-org/bincode#594 and its duplicate bincode-org/bincode#531 .
As before, if this looks good, a crates.io release of
virtuewould be appreciated so I can file a PR forbincode.I elected to use a
generatedsubdirectory as this approach might be used by multiple crates, and it seems reasonable to establish an informal naming standard. Note that IDEs will typically pretty-print directories that only contain a single subdirectory: