From 5fe61419a78ebfe8f0b6df8c055e0b484fd4faac Mon Sep 17 00:00:00 2001 From: rimutaka Date: Tue, 31 May 2022 13:39:00 +1200 Subject: [PATCH] Added BaseType and WrapType impl for HashSet --- juniper/src/macros/reflect.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/juniper/src/macros/reflect.rs b/juniper/src/macros/reflect.rs index 4cba097f..155786c8 100644 --- a/juniper/src/macros/reflect.rs +++ b/juniper/src/macros/reflect.rs @@ -1,6 +1,6 @@ //! Compile-time reflection of Rust types into GraphQL types. -use std::{rc::Rc, sync::Arc}; +use std::{collections::HashSet, rc::Rc, sync::Arc}; use futures::future::BoxFuture; @@ -72,6 +72,10 @@ impl> BaseType for Vec { const NAME: Type = T::NAME; } +impl> BaseType for HashSet { + const NAME: Type = T::NAME; +} + impl> BaseType for [T] { const NAME: Type = T::NAME; } @@ -133,6 +137,10 @@ impl> BaseSubTypes for Vec { const NAMES: Types = T::NAMES; } +impl> BaseSubTypes for HashSet { + const NAMES: Types = T::NAMES; +} + impl> BaseSubTypes for [T] { const NAMES: Types = T::NAMES; } @@ -229,6 +237,10 @@ impl> WrappedType for Vec { const VALUE: u128 = T::VALUE * 10 + 3; } +impl> WrappedType for HashSet { + const VALUE: u128 = T::VALUE * 10 + 3; +} + impl> WrappedType for [T] { const VALUE: u128 = T::VALUE * 10 + 3; }