Skip to content

Commit a7d6f1c

Browse files
Generate one file per XDR type (#520)
* generate one file per type instead of one big file * group ifdef/else definitions into same file * remove redundant cfg from mod/pub use lines * move generated/mod.rs to generated.rs * allow clippy::wildcard_imports in generated code * makefile wildcard Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Revert "makefile wildcard" This reverts commit 73b3da3. * use find for rustfmt to avoid glob expansion issues * add blank line after use import in generated files --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5bc58f8 commit a7d6f1c

494 files changed

Lines changed: 53132 additions & 50506 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ src/generated.rs: $(sort $(wildcard xdr/*.x))
4343
--output $@ \
4444
--custom-default $(CUSTOM_DEFAULT_IMPL) \
4545
--custom-str $(CUSTOM_STR_IMPL)
46-
rustfmt $@
46+
rustfmt $@ && find src/generated -name '*.rs' | xargs rustfmt
4747

4848
xdr-version: $(wildcard .git/modules/xdr/**/*) $(wildcard xdr/*.x)
4949
git submodule status -- xdr | sed 's/^ *//g' | cut -f 1 -d " " | tr -d '\n' | tr -d '+' > xdr-version
@@ -54,6 +54,7 @@ xdr-json: src/generated.rs
5454

5555
clean:
5656
rm -f src/generated.rs
57+
rm -rf src/generated
5758
rm -f xdr-version
5859
rm -fr xdr-json
5960
cargo clean --quiet

0 commit comments

Comments
 (0)