From 6e12b00b3fd8812b0f473f1419e13c691349833c Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 12 Jul 2021 13:26:17 +0200 Subject: [PATCH] Re-add `new` constructor functions for ComponentCompiler and CompilerConfiguration Amends commit dc51d4ccda4af28ca89467e0084718afdb1a7aab As discussed in #310 --- api/sixtyfps-rs/sixtyfps-build/lib.rs | 5 +++++ sixtyfps_runtime/interpreter/api.rs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/api/sixtyfps-rs/sixtyfps-build/lib.rs b/api/sixtyfps-rs/sixtyfps-build/lib.rs index 5fe405263..bbcfc20c7 100644 --- a/api/sixtyfps-rs/sixtyfps-build/lib.rs +++ b/api/sixtyfps-rs/sixtyfps-build/lib.rs @@ -72,6 +72,11 @@ impl Default for CompilerConfiguration { } impl CompilerConfiguration { + /// Creates a new default configuration. + pub fn new() -> Self { + Self::default() + } + /// Create a new configuration that includes sets the include paths used for looking up /// `.60` imports to the specified vector of paths. pub fn with_include_paths(self, include_paths: Vec) -> Self { diff --git a/sixtyfps_runtime/interpreter/api.rs b/sixtyfps_runtime/interpreter/api.rs index f3641b249..2548b7f7a 100644 --- a/sixtyfps_runtime/interpreter/api.rs +++ b/sixtyfps_runtime/interpreter/api.rs @@ -430,6 +430,11 @@ impl Default for ComponentCompiler { } impl ComponentCompiler { + /// Returns a new ComponentCompiler. + pub fn new() -> Self { + Self::default() + } + /// Sets the include paths used for looking up `.60` imports to the specified vector of paths. pub fn set_include_paths(&mut self, include_paths: Vec) { self.config.include_paths = include_paths;