From 144d6b9d4d327debae13392715103a3208ce8a45 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 12 May 2021 11:17:52 -0300 Subject: [PATCH] feat(core): add mutable `config` getter on the `Context` struct (#1803) --- .changes/config-mut-getter.md | 5 +++++ core/tauri/src/lib.rs | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changes/config-mut-getter.md diff --git a/.changes/config-mut-getter.md b/.changes/config-mut-getter.md new file mode 100644 index 000000000..93a24dd5a --- /dev/null +++ b/.changes/config-mut-getter.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Adds a mutable `config` getter on the `Context` struct. diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 3a13ffff2..c0593099e 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -142,6 +142,12 @@ impl Context { &self.config } + /// A mutable reference to the config the application was prepared with. + #[inline(always)] + pub fn config_mut(&mut self) -> &mut Config { + &mut self.config + } + /// The assets to be served directly by Tauri. #[inline(always)] pub fn assets(&self) -> Arc {