config: change default config to use toml-based configuration
This commit is contained in:
parent
e24a61bc62
commit
3cebf651c5
58 changed files with 14093 additions and 145 deletions
48
toml-config/src/config/parsers.rs
Normal file
48
toml-config/src/config/parsers.rs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
use {
|
||||
crate::{
|
||||
config::parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||
toml::toml_span::Span,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub mod action;
|
||||
mod color;
|
||||
pub mod config;
|
||||
mod connector;
|
||||
mod connector_match;
|
||||
mod drm_device;
|
||||
mod drm_device_match;
|
||||
mod env;
|
||||
pub mod exec;
|
||||
mod gfx_api;
|
||||
mod idle;
|
||||
mod input;
|
||||
mod input_match;
|
||||
pub mod keymap;
|
||||
mod log_level;
|
||||
mod mode;
|
||||
pub mod modified_keysym;
|
||||
mod output;
|
||||
mod output_match;
|
||||
pub mod shortcuts;
|
||||
mod status;
|
||||
mod theme;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum StringParserError {
|
||||
#[error(transparent)]
|
||||
Expected(#[from] UnexpectedDataType),
|
||||
}
|
||||
|
||||
pub struct StringParser;
|
||||
|
||||
impl Parser for StringParser {
|
||||
type Value = String;
|
||||
type Error = StringParserError;
|
||||
const EXPECTED: &'static [DataType] = &[DataType::String];
|
||||
|
||||
fn parse_string(&mut self, _span: Span, string: &str) -> ParseResult<Self> {
|
||||
Ok(string.to_string())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue