diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-12-21 02:44:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 02:44:38 +0000 |
commit | 6e1b9d8b2502f5b47dc28eb5e0853e46ad8b4e84 (patch) | |
tree | 623a6cd8785529b28cc28af201c26b56fb47ac46 /CHANGELOG.md | |
parent | 37a3198d8882463c9873011c1d18c325ea46d7c8 (diff) |
Replace serde's derive with custom proc macro
This replaces the existing `Deserialize` derive from serde with a
`ConfigDeserialize` derive. The goal of this new proc macro is to allow
a more error-friendly deserialization for the Alacritty configuration
file without having to manage a lot of boilerplate code inside the
configuration modules.
The first part of the derive macro is for struct deserialization. This
takes structs which have `Default` implemented and will only replace
fields which can be successfully deserialized. Otherwise the `log` crate
is used for printing errors. Since this deserialization takes the
default value from the struct instead of the value, it removes the
necessity for creating new types just to implement `Default` on them for
deserialization.
Additionally, the struct deserialization also checks for `Option` values
and makes sure that explicitly specifying `none` as text literal is
allowed for all options.
The other part of the derive macro is responsible for deserializing
enums. While only enums with Unit variants are supported, it will
automatically implement a deserializer for these enums which accepts any
form of capitalization.
Since this custom derive prevents us from using serde's attributes on
fields, some of the attributes have been reimplemented for
`ConfigDeserialize`. These include `#[config(flatten)]`,
`#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute
is currently limited to at most one per struct.
Additionally the `#[config(deprecated = "optional message")]` attribute
allows easily defining uniform deprecation messages for fields on
structs.
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r-- | CHANGELOG.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c005e62..ae6deaea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Nonexistent config imports are ignored instead of raising an error +- Value for disabling logging with `config.log_level` is `Off` instead of `None` ### Fixed @@ -51,6 +52,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * `--dimensions` * `--position` - `live-shader-reload` feature +- Config option `dynamic_title`, you should use `window.dynamic_title` instead +- Config option `scrolling.faux_multiplier`, which was replaced by escape `CSI ? 1007 h/l` ## 0.6.0 |