From 1db143e8b0ab9bb83f74b305b6bc19f61688ad96 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 11 Feb 2022 17:08:48 +0000 Subject: [PATCH 1/3] Export codegen::TypeGenerator --- codegen/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index e65dc26195..ccdac7f5b8 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -25,5 +25,8 @@ pub use self::{ generate_runtime_api, RuntimeGenerator, }, - types::GeneratedTypeDerives, + types::{ + GeneratedTypeDerives, + TypeGenerator, + }, }; From e259205d6d536a035a498c0547a19cfd56f0840a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 11 Feb 2022 17:42:35 +0000 Subject: [PATCH 2/3] Export Module and add comments to public methods --- codegen/src/lib.rs | 1 + codegen/src/types/mod.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index ccdac7f5b8..f8136823f6 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -28,5 +28,6 @@ pub use self::{ types::{ GeneratedTypeDerives, TypeGenerator, + Module, }, }; diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index b6972bdc7f..c29dbd3412 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -221,6 +221,7 @@ impl<'a> TypeGenerator<'a> { } } +/// Represents a Rust `mod`, containing generated types and child `mod`s. #[derive(Debug)] pub struct Module<'a> { name: Ident, @@ -248,7 +249,8 @@ impl<'a> ToTokens for Module<'a> { } impl<'a> Module<'a> { - pub fn new(name: Ident, root_mod: Ident) -> Self { + /// Create a new [`Module`], with a reference to the root `mod` for resolving type paths. + pub(crate) fn new(name: Ident, root_mod: Ident) -> Self { Self { name, root_mod, From 1fa29f2b0422c22f295ea901870e2355da4838e1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 11 Feb 2022 17:43:45 +0000 Subject: [PATCH 3/3] Fmt --- codegen/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index f8136823f6..523b0d72ca 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -27,7 +27,7 @@ pub use self::{ }, types::{ GeneratedTypeDerives, - TypeGenerator, Module, + TypeGenerator, }, };