From 3c0cad7d32c65a1e7d6272714c65deb65d07b92c Mon Sep 17 00:00:00 2001 From: Max Audron Date: Tue, 19 Dec 2023 19:46:37 +0100 Subject: decromulate ignorelistmanager i32 type impl and derive this was for whatever reason pretty confusing, but there is no need to impl the Network trait here, we should instead be using From impls for going to the Variant and i32 directly. That way the code becomes cleaner and we don't have to worry about these conversions anymore. --- derive/src/network/maplist.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'derive/src/network') diff --git a/derive/src/network/maplist.rs b/derive/src/network/maplist.rs index 94eb04b..19877cb 100644 --- a/derive/src/network/maplist.rs +++ b/derive/src/network/maplist.rs @@ -77,7 +77,7 @@ pub(crate) fn to_vec(_type_name: &Ident, fields: &Vec) -> TokenStr } } else { quote! { - item.#field_name.clone() + item.#field_name.clone().into() } }; @@ -147,7 +147,7 @@ pub(crate) fn from(fields: &Vec) -> Vec { let field_inner = if field.network { quote! { - libquassel::message::Network::from_network(&mut std::convert::TryInto::try_into(input.remove(0)).unwrap()) + libquassel::message::NetworkList::from_network_list(&mut std::convert::TryInto::try_into(input.remove(0)).unwrap()) } } else { quote! { @@ -202,7 +202,7 @@ pub(crate) fn from_vec(type_name: &Ident, fields: &Vec, new: bool) } } else { quote! { - #type_name::from_network(input) + #type_name::from_network_list(input) } }; -- cgit v1.2.3