aboutsummaryrefslogtreecommitdiff
path: root/src/transform.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transform.rs')
-rw-r--r--src/transform.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/transform.rs b/src/transform.rs
index 05866b6..11a98c2 100644
--- a/src/transform.rs
+++ b/src/transform.rs
@@ -17,6 +17,7 @@ use crate::{
#[derive(Default)]
pub struct TypeConverter<'a> {
pub assoc_type_conversions: HashMap<Ident, DestType<'a>>,
+ pub collections: HashMap<Ident, usize>,
}
#[derive(Debug)]
@@ -39,6 +40,10 @@ impl TypeConverter<'_> {
/// ... etc. A return type of None means the type isn't recognized.
#[rustfmt::skip]
fn get_collection_type_count(&self, ident: &Ident) -> Option<usize> {
+ if let Some(count) = self.collections.get(ident) {
+ return Some(*count);
+ }
+
// when adding a type here don't forget to document it in the README
if ident == "Vec" { return Some(1); }
if ident == "VecDeque" { return Some(1); }