From 866d2d9c029c2aca6a83d55e846d7519be5f3aeb Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Fri, 5 Aug 2022 20:17:26 +0000 Subject: [PATCH] Fix optional return type --- qbittorrent-web-api-gen/src/generate/group.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qbittorrent-web-api-gen/src/generate/group.rs b/qbittorrent-web-api-gen/src/generate/group.rs index 01a5d25..114fd32 100644 --- a/qbittorrent-web-api-gen/src/generate/group.rs +++ b/qbittorrent-web-api-gen/src/generate/group.rs @@ -97,6 +97,12 @@ impl types::Type { }, }; + let owned_type = if self.is_optional() { + quote! { std::option::Option<#owned_type> } + } else { + owned_type + }; + if self.is_list() { quote! { std::vec::Vec<#owned_type> } } else {