Replace itertools dependency
diff --git a/Cargo.toml b/Cargo.toml
index eff5820..f9d9b52 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,6 @@
 cc = "1.0.49"
 codespan-reporting = "0.9"
 cxxbridge-macro = { version = "=0.2.9", path = "macro" }
-itertools = "0.9"
 link-cplusplus = "1.0"
 proc-macro2 = { version = "1.0", features = ["span-locations"] }
 quote = "1.0"
diff --git a/gen/write.rs b/gen/write.rs
index 9a2e4c8..a77c658 100644
--- a/gen/write.rs
+++ b/gen/write.rs
@@ -3,8 +3,8 @@
 use crate::gen::{include, Opt};
 use crate::syntax::atom::Atom::{self, *};
 use crate::syntax::{Api, ExternFn, ExternType, Receiver, Signature, Struct, Type, Types, Var};
-use itertools::Itertools;
 use proc_macro2::Ident;
+use std::collections::HashMap;
 
 pub(super) fn gen(
     namespace: Namespace,
@@ -45,16 +45,17 @@
         }
     }
 
-    let methods_for_type = apis
-        .iter()
-        .filter_map(|api| match api {
-            Api::RustFunction(efn) => match &efn.sig.receiver {
-                Some(rcvr) => Some((&rcvr.ident, efn)),
-                _ => None,
-            },
-            _ => None,
-        })
-        .into_group_map();
+    let mut methods_for_type = HashMap::new();
+    for api in apis {
+        if let Api::RustFunction(efn) = api {
+            if let Some(receiver) = &efn.sig.receiver {
+                methods_for_type
+                    .entry(&receiver.ident)
+                    .or_insert_with(Vec::new)
+                    .push(efn);
+            }
+        }
+    }
 
     for api in apis {
         match api {