From cb46ce13b434b55a85f894a6ec167c80d2d9901e Mon Sep 17 00:00:00 2001 From: trevyn <230691+trevyn@users.noreply.github.com> Date: Thu, 3 Nov 2022 12:13:09 +0400 Subject: [PATCH] Move generated files to `target/generated/bincode` (#600) --- README.md | 2 +- derive/Cargo.toml | 2 +- derive/readme.md | 2 +- derive/src/lib.rs | 6 +++--- src/de/mod.rs | 2 +- src/enc/mod.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aeda560..79a65d7 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,4 @@ Bincode will encode enum variants as a `u32`. If you're worried about storage si Currently we have not found a compelling case to respect `#[repr(...)]`. You're most likely trying to interop with a format that is similar-but-not-quite-bincode. We only support our own protocol ([spec](https://github.com/bincode-org/bincode/blob/trunk/docs/spec.md)). -If you really want to use bincode to encode/decode a different protocol, consider implementing `Encode` and `Decode` yourself. `bincode-derive` will output the generated implementation in `target/_Encode.rs` and `target/_Decode.rs` which should get you started. +If you really want to use bincode to encode/decode a different protocol, consider implementing `Encode` and `Decode` yourself. `bincode-derive` will output the generated implementation in `target/generated/bincode/_Encode.rs` and `target/generated/bincode/_Decode.rs` which should get you started. diff --git a/derive/Cargo.toml b/derive/Cargo.toml index 6c8ccde..be9b566 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -19,4 +19,4 @@ description = "Implementation of #[derive(Encode, Decode)] for bincode" proc-macro = true [dependencies] -virtue = "0.0.10" +virtue = "0.0.11" diff --git a/derive/readme.md b/derive/readme.md index 22f216a..0e652ce 100644 --- a/derive/readme.md +++ b/derive/readme.md @@ -25,4 +25,4 @@ This is supported by the structs in `src/generate`. The most notable points of t For additional derive testing, see the test cases in `../tests` -For testing purposes, all generated code is outputted to the current `target` folder, under file name `_Encode.rs` and `_Decode.rs`. This can help with debugging. +For testing purposes, all generated code is outputted to the current `target/generated/bincode` folder, under file name `_Encode.rs` and `_Decode.rs`. This can help with debugging. diff --git a/derive/src/lib.rs b/derive/src/lib.rs index c4aec81..166bb2f 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -34,7 +34,7 @@ fn derive_encode_inner(input: TokenStream) -> Result { } } - generator.export_to_file("Encode"); + generator.export_to_file("bincode", "Encode"); generator.finish() } @@ -67,7 +67,7 @@ fn derive_decode_inner(input: TokenStream) -> Result { } } - generator.export_to_file("Decode"); + generator.export_to_file("bincode", "Decode"); generator.finish() } @@ -100,6 +100,6 @@ fn derive_borrow_decode_inner(input: TokenStream) -> Result { } } - generator.export_to_file("BorrowDecode"); + generator.export_to_file("bincode", "BorrowDecode"); generator.finish() } diff --git a/src/de/mod.rs b/src/de/mod.rs index d603782..07f35e3 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -26,7 +26,7 @@ pub use self::decoder::DecoderImpl; /// /// # Implementing this trait manually /// -/// If you want to implement this trait for your type, the easiest way is to add a `#[derive(bincode::Decode)]`, build and check your `target/` folder. This should generate a `_Decode.rs` file. +/// If you want to implement this trait for your type, the easiest way is to add a `#[derive(bincode::Decode)]`, build and check your `target/generated/bincode/` folder. This should generate a `_Decode.rs` file. /// /// For this struct: /// diff --git a/src/enc/mod.rs b/src/enc/mod.rs index 80fdcb6..5166b9e 100644 --- a/src/enc/mod.rs +++ b/src/enc/mod.rs @@ -17,7 +17,7 @@ pub use self::encoder::EncoderImpl; /// /// # Implementing this trait manually /// -/// If you want to implement this trait for your type, the easiest way is to add a `#[derive(bincode::Encode)]`, build and check your `target/` folder. This should generate a `_Encode.rs` file. +/// If you want to implement this trait for your type, the easiest way is to add a `#[derive(bincode::Encode)]`, build and check your `target/generated/bincode/` folder. This should generate a `_Encode.rs` file. /// /// For this struct: ///