1
0
Fork 0
forked from wry/wry

all: set rust edition to 2024

This commit is contained in:
Julian Orth 2025-02-21 10:44:29 +01:00
parent 02a18f620b
commit 3338909170
515 changed files with 1225 additions and 1187 deletions

View file

@ -1,10 +1,12 @@
use {
crate::{
config::{
Action,
context::Context,
extractor::{arr, bol, n32, opt, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, arr, bol, n32, opt, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
StringParser, StringParserError,
connector::{ConnectorParser, ConnectorParserError},
drm_device::{DrmDeviceParser, DrmDeviceParserError},
drm_device_match::{DrmDeviceMatchParser, DrmDeviceMatchParserError},
@ -20,10 +22,8 @@ use {
repeat_rate::{RepeatRateParser, RepeatRateParserError},
status::{StatusParser, StatusParserError},
theme::{ThemeParser, ThemeParserError},
StringParser, StringParserError,
},
spanned::SpannedErrorExt,
Action,
},
toml::{
toml_span::{DespanExt, Span, Spanned, SpannedExt},
@ -32,8 +32,8 @@ use {
},
indexmap::IndexMap,
jay_config::{
get_workspace,
Axis::{Horizontal, Vertical},
get_workspace,
},
thiserror::Error,
};
@ -114,7 +114,9 @@ impl ActionParser<'_> {
"enable-window-management" => EnableWindowManagement(true),
"disable-window-management" => EnableWindowManagement(false),
_ => {
return Err(ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span))
return Err(
ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span)
);
}
};
Ok(Action::SimpleCommand { cmd })

View file

@ -1,8 +1,9 @@
use {
crate::{
config::{
Action, Config, Libei, Theme, UiDrag,
context::Context,
extractor::{arr, bol, opt, recover, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, arr, bol, opt, recover, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
action::ActionParser,
@ -19,8 +20,8 @@ use {
output::OutputsParser,
repeat_rate::RepeatRateParser,
shortcuts::{
parse_modified_keysym_str, ComplexShortcutsParser, ShortcutsParser,
ShortcutsParserError,
ComplexShortcutsParser, ShortcutsParser, ShortcutsParserError,
parse_modified_keysym_str,
},
status::StatusParser,
tearing::TearingParser,
@ -30,7 +31,6 @@ use {
xwayland::XwaylandParser,
},
spanned::SpannedErrorExt,
Action, Config, Libei, Theme, UiDrag,
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,11 +1,11 @@
use {
crate::{
config::{
ConfigConnector,
context::Context,
extractor::{bol, opt, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, bol, opt, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::connector_match::{ConnectorMatchParser, ConnectorMatchParserError},
ConfigConnector,
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{opt, str, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
ConnectorMatch,
context::Context,
extractor::{Extractor, ExtractorError, opt, str},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{Span, Spanned},

View file

@ -1,14 +1,14 @@
use {
crate::{
config::{
ConfigDrmDevice,
context::Context,
extractor::{bol, fltorint, opt, recover, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, bol, fltorint, opt, recover, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
drm_device_match::{DrmDeviceMatchParser, DrmDeviceMatchParserError},
gfx_api::GfxApiParser,
},
ConfigDrmDevice,
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{n32, opt, recover, str, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
DrmDeviceMatch,
context::Context,
extractor::{Extractor, ExtractorError, n32, opt, recover, str},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,14 +1,14 @@
use {
crate::{
config::{
Exec,
context::Context,
extractor::{arr, bol, opt, recover, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, arr, bol, opt, recover, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
env::{EnvParser, EnvParserError},
StringParser, StringParserError,
env::{EnvParser, EnvParserError},
},
Exec,
},
toml::{
toml_span::{DespanExt, Span, Spanned, SpannedExt},

View file

@ -2,7 +2,7 @@ use {
crate::{
config::{
context::Context,
extractor::{n64, opt, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, n64, opt, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{

View file

@ -1,8 +1,9 @@
use {
crate::{
config::{
Input,
context::Context,
extractor::{bol, fltorint, opt, recover, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, bol, fltorint, opt, recover, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
action::ActionParser,
@ -10,7 +11,6 @@ use {
keymap::KeymapParser,
output_match::OutputMatchParser,
},
Input,
},
toml::{
toml_span::{DespanExt, Span, Spanned, SpannedExt},
@ -20,8 +20,8 @@ use {
ahash::AHashMap,
indexmap::IndexMap,
jay_config::input::{
acceleration::{ACCEL_PROFILE_ADAPTIVE, ACCEL_PROFILE_FLAT},
SwitchEvent,
acceleration::{ACCEL_PROFILE_ADAPTIVE, ACCEL_PROFILE_FLAT},
},
thiserror::Error,
};

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{bol, opt, str, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
InputMatch,
context::Context,
extractor::{Extractor, ExtractorError, bol, opt, str},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{opt, str, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
ConfigKeymap,
context::Context,
extractor::{Extractor, ExtractorError, opt, str},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{Span, Spanned, SpannedExt},
@ -14,7 +14,7 @@ use {
indexmap::IndexMap,
jay_config::{
config_dir,
keyboard::{parse_keymap, Keymap},
keyboard::{Keymap, parse_keymap},
},
std::{io, path::PathBuf},
thiserror::Error,
@ -73,7 +73,7 @@ impl Parser for KeymapParser<'_> {
Ok(c) => c,
Err(e) => {
return Err(KeymapParserError::ReadFile(root.display().to_string(), e)
.spanned(path.span))
.spanned(path.span));
}
};
map_val = Some(file_content.as_str().spanned(path.span));

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{bol, opt, recover, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
Libei,
context::Context,
extractor::{Extractor, ExtractorError, bol, opt, recover},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{fltorint, opt, s32, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
Mode,
context::Context,
extractor::{Extractor, ExtractorError, fltorint, opt, s32},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -7,11 +7,11 @@ use {
toml::toml_span::{Span, SpannedExt},
},
jay_config::keyboard::{
ModifiedKeySym,
mods::{
Modifiers, ALT, CAPS, CTRL, LOCK, LOGO, MOD1, MOD2, MOD3, MOD4, MOD5, NUM, RELEASE,
ALT, CAPS, CTRL, LOCK, LOGO, MOD1, MOD2, MOD3, MOD4, MOD5, Modifiers, NUM, RELEASE,
SHIFT,
},
ModifiedKeySym,
},
thiserror::Error,
};
@ -51,7 +51,7 @@ impl Parser for ModifiedKeysymParser {
Some(_) => return Err(ModifiedKeysymParserError::MoreThanOneSym.spanned(span)),
_ => {
return Err(ModifiedKeysymParserError::UnknownKeysym(part.to_string())
.spanned(span))
.spanned(span));
}
},
};

View file

@ -1,8 +1,9 @@
use {
crate::{
config::{
Output,
context::Context,
extractor::{fltorint, opt, recover, s32, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, fltorint, opt, recover, s32, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
format::FormatParser,
@ -11,7 +12,6 @@ use {
tearing::TearingParser,
vrr::VrrParser,
},
Output,
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{opt, str, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
OutputMatch,
context::Context,
extractor::{Extractor, ExtractorError, opt, str},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{s32, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
RepeatRate,
context::Context,
extractor::{Extractor, ExtractorError, s32},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{Span, Spanned},

View file

@ -1,8 +1,9 @@
use {
crate::{
config::{
Action, Shortcut, SimpleCommand,
context::Context,
extractor::{opt, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, opt, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::{
action::{ActionParser, ActionParserError},
@ -11,7 +12,6 @@ use {
},
},
spanned::SpannedErrorExt,
Action, Shortcut, SimpleCommand,
},
toml::{
toml_span::{Span, Spanned, SpannedExt},
@ -19,7 +19,7 @@ use {
},
},
indexmap::IndexMap,
jay_config::keyboard::{mods::Modifiers, ModifiedKeySym},
jay_config::keyboard::{ModifiedKeySym, mods::Modifiers},
std::collections::HashSet,
thiserror::Error,
};

View file

@ -1,11 +1,11 @@
use {
crate::{
config::{
Status,
context::Context,
extractor::{opt, recover, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, opt, recover, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::exec::{ExecParser, ExecParserError},
Status,
},
toml::{
toml_span::{Span, Spanned, SpannedExt},
@ -55,7 +55,7 @@ impl Parser for StatusParser<'_> {
_ => {
return Err(
StatusParserError::UnknownFormat(f.value.to_string()).spanned(f.span)
)
);
}
},
_ => MessageFormat::Plain,

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{opt, val, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
Tearing,
context::Context,
extractor::{Extractor, ExtractorError, opt, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{Span, Spanned, SpannedExt},

View file

@ -1,11 +1,11 @@
use {
crate::{
config::{
Theme,
context::Context,
extractor::{opt, recover, s32, str, val, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, opt, recover, s32, str, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::color::ColorParser,
Theme,
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,11 +1,11 @@
use {
crate::{
config::{
UiDrag,
context::Context,
extractor::{bol, int, opt, recover, Extractor, ExtractorError},
extractor::{Extractor, ExtractorError, bol, int, opt, recover},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
parsers::exec::ExecParserError,
UiDrag,
},
toml::{
toml_span::{DespanExt, Span, Spanned},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{opt, val, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
Vrr,
context::Context,
extractor::{Extractor, ExtractorError, opt, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{Span, Spanned, SpannedExt},

View file

@ -1,10 +1,10 @@
use {
crate::{
config::{
context::Context,
extractor::{opt, val, Extractor, ExtractorError},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
Xwayland,
context::Context,
extractor::{Extractor, ExtractorError, opt, val},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
},
toml::{
toml_span::{Span, Spanned, SpannedExt},