Skip to content

Commit

Permalink
Merge pull request #169 from rruckley/Fix-add-party-167
Browse files Browse the repository at this point in the history
Fix add party
  • Loading branch information
rruckley authored Jul 29, 2024
2 parents 95f4231 + d60cc03 commit 19e33e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tmflib-derive/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tmflib-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tmflib-derive"
version = "0.1.26"
version = "0.1.27"
edition = "2021"
authors = ["Ryan Ruckley <[email protected]>"]
description = "Derive macro for the tmflib::HasId trait"
Expand All @@ -13,4 +13,4 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = "2.0.70"
syn = "2.0.72"
5 changes: 4 additions & 1 deletion tmflib-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ pub fn hasrelatedparty_derive(input: TokenStream) -> TokenStream {
let out = quote! {
impl HasRelatedParty for #name {
fn add_party(&mut self, party : RelatedParty) {
self.related_party.as_mut().unwrap().push(party);
match self.related_party.as_mut() {
Some(v) => v.push(party),
None => self.related_party = Some(vec![party]),
}
}
fn get_party(&self, idx : usize ) -> Option<&RelatedParty> {
match self.related_party.as_ref() {
Expand Down

0 comments on commit 19e33e2

Please sign in to comment.