From c5a02e6134a470cca5d401c7ba571b791509681c Mon Sep 17 00:00:00 2001 From: Christian Riedel Date: Mon, 6 Dec 2021 18:35:32 +0100 Subject: [PATCH] put Config struct into own mod changes cause rustc ICE propably related to: https://github.com/rust-lang/rust/issues/90682 --- src-tauri/src/config.rs | 27 ++------------------------- src-tauri/src/config/types.rs | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 src-tauri/src/config/types.rs diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index bebabd81..e109ab94 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -1,33 +1,10 @@ mod file; pub mod setup; +pub mod types; mod util; use self::file::get_conf_file_path; - -/// The user specific part of the confiuration. -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct User { - pub name: Option, -} - -/// The application specific part of the confiuration. -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct Settings { - pub database_uri: Option, - pub language: String, - pub log_level: String, - pub theme: String, - pub today_autoscroll_left_offset: i32, - pub year_change_scroll_begin: bool, - pub year_to_show: Option, -} - -/// The configuration object. -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct Config { - pub user: Option, - pub settings: Settings, -} +pub use self::types::Config; // NOTE: Change defaults also in frontend initial State /// Default configuration of RUlaub as TOML string. diff --git a/src-tauri/src/config/types.rs b/src-tauri/src/config/types.rs new file mode 100644 index 00000000..8fa79561 --- /dev/null +++ b/src-tauri/src/config/types.rs @@ -0,0 +1,24 @@ +/// The user specific part of the confiuration. +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct User { + pub name: Option, +} + +/// The application specific part of the confiuration. +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct Settings { + pub database_uri: Option, + pub language: String, + pub log_level: String, + pub theme: String, + pub today_autoscroll_left_offset: i32, + pub year_change_scroll_begin: bool, + pub year_to_show: Option, +} + +/// The configuration object. +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct Config { + pub user: Option, + pub settings: Settings, +}