1. 06 Apr, 2021 1 commit
    • Bastian Köcher's avatar
      Adds support for custom where bounds (#263) · 46c19554
      Bastian Köcher authored
      
      
      * Adds support for custom where bounds
      
      The user can now specify a custom where bound when using the derive
      macros:
      
      - `#[codec(encode_bound(T: Encode))]` for `Encode`
      - `#[codec(decode_bound(T: Encode))]` for `Decode`
      
      If nothing is specified (`encode_bound()`) the where bounds will be empty.
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarGavin Wood <gavin@parity.io>
      46c19554
  2. 26 Feb, 2021 1 commit
  3. 26 Jan, 2021 1 commit
  4. 25 Jan, 2021 1 commit
  5. 14 Jan, 2021 1 commit
  6. 04 Jan, 2021 1 commit
  7. 10 Sep, 2020 1 commit
  8. 30 May, 2020 1 commit
    • Aaron Hill's avatar
      Use proper span when emitting 'self' identifier (#210) · 353db2cf
      Aaron Hill authored
      Normally, the span of a field has the same hygiene context as
      `Span::call_site`. However, it's possible for a struct definition
      to be 'constructed' via a `macro_rules` macro such that the field
      has a different hygiene context. This will cause the expanded code
      to be unable to resolve any references to `self`, resulting in a
      compilation error.
      
      This pull request uses `quote!` instead of `quote_spanned!` when
      emitting a 'self' identifier. `quote_spanned!` is still used for
      everything else in the emitted method, meaning that error messages
      will still point to the proper field.
      
      I've included a test case which triggers this issue on
      Rust 1.43.1. It's current difficult to hit this issue
      other than in this artificial case, but that will change
      once rust-lang/rust#72622 is re-landed.
      353db2cf
  9. 08 Apr, 2020 1 commit
  10. 02 Apr, 2020 1 commit
  11. 03 Mar, 2020 2 commits
  12. 20 Dec, 2019 1 commit
  13. 09 Dec, 2019 1 commit
  14. 06 Dec, 2019 1 commit
  15. 13 Nov, 2019 2 commits
  16. 27 Sep, 2019 1 commit
  17. 26 Sep, 2019 1 commit
  18. 25 Sep, 2019 1 commit
  19. 24 Sep, 2019 1 commit
  20. 29 Jul, 2019 2 commits
  21. 25 Jul, 2019 1 commit
  22. 24 Jul, 2019 1 commit
  23. 21 Jul, 2019 1 commit
  24. 19 Jul, 2019 1 commit
  25. 17 Jul, 2019 1 commit
  26. 12 Jun, 2019 1 commit
    • Andrew Jones's avatar
      Derive `CompactAs` for single field structs (#97) · 215cda34
      Andrew Jones authored
      * Basic CompactAs derive
      
      * Support single field named structs
      
      * Extract function to wrap impl in dummy const
      
      * Support single non-skipped field
      
      * Restore original include_parity_scale_codec_crate function
      
      * Add test for Compact<T> codec
      215cda34
  27. 04 Jun, 2019 1 commit
  28. 15 Apr, 2019 1 commit
  29. 02 Apr, 2019 1 commit
    • Bastian Köcher's avatar
      Port derive empty enum to master (#66) · bdcbe67f
      Bastian Köcher authored
      
      
      * release parity-codec v3.2
      
      * impl skip fields and variants (#58)
      
      * impl skip variants
      
      * impl skip on fields
      
      * reorganize code
      
      * in code rename
      
      Co-Authored-By: thiolliere's avatarthiolliere <gui.thiolliere@gmail.com>
      
      * in code rename
      
      * code refactor
      
      * refactor: variant filter
      
      * new version of derive (#61)
      
      * release codec-v3.3 that forward derive-v3.2 (#63)
      
      * Implement derive for empty enums
      
      * Bump version of parity-codec-derive to 3.3
      
      * Fixes test
      bdcbe67f
  30. 01 Apr, 2019 1 commit
  31. 12 Mar, 2019 1 commit
  32. 08 Mar, 2019 1 commit
    • Fedor Sakharov's avatar
      decode returns Result instead of Option (#52) · b4a784d3
      Fedor Sakharov authored
      * decode returns Result instead of Option
      
      Fixes #33
      
      * don't use String inside Error
      
      * some fixes to formatting and error messages
      
      * fix review
      
      * implements std::error::Error and std::fmt::Display for Error
      * removes implementation of ToString
      * fixes error message for decoding Enum
      * generate error messages with format!() outside of the quote!()
      
      * refactors error message generation
      
      * adds simple sanity tests
      
      * adds from str implementation for error
      
      * adds tests for named structs fields
      
      * remove all the literal error messages from no_std builds
      
      * brings back PartialEq lost along the way
      
      * fix review v3
      b4a784d3
  33. 28 Feb, 2019 2 commits
  34. 12 Feb, 2019 2 commits
  35. 08 Feb, 2019 1 commit