diff --git a/src/builders/module.rs b/src/builders/module.rs index 929f2cf30..1eea007e5 100644 --- a/src/builders/module.rs +++ b/src/builders/module.rs @@ -76,6 +76,26 @@ impl ModuleBuilder<'_> { } } + /// Overrides module name. + /// + /// # Arguments + /// + /// * `name` - The name of the extension. + pub fn name(mut self, name: impl Into) -> Self { + self.name = name.into(); + self + } + + /// Overrides module version. + /// + /// # Arguments + /// + /// * `version` - The current version of the extension. + pub fn version(mut self, version: impl Into) -> Self { + self.version = version.into(); + self + } + /// Sets the startup function for the extension. /// /// # Arguments @@ -373,6 +393,18 @@ mod tests { assert!(builder.enums.is_empty()); } + #[test] + fn test_name() { + let builder = ModuleBuilder::new("test", "1.0").name("new_test"); + assert_eq!(builder.name, "new_test"); + } + + #[test] + fn test_version() { + let builder = ModuleBuilder::new("test", "1.0").version("2.0"); + assert_eq!(builder.version, "2.0"); + } + #[test] fn test_startup_function() { let builder =