Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump toml from 0.5.10 to 0.6.0 #5656

Merged
merged 4 commits into from
Jan 24, 2023

Commits on Jan 24, 2023

  1. build(deps): bump toml from 0.5.10 to 0.6.0

    Bumps [toml](https://github.com/toml-rs/toml) from 0.5.10 to 0.6.0.
    - [Release notes](https://github.com/toml-rs/toml/releases)
    - [Commits](toml-rs/toml@toml-v0.5.10...toml-v0.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: toml
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored and the-mikedavis committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    6126b62 View commit details
    Browse the repository at this point in the history
  2. Fix compatibility with toml 0.6.0

    `toml::from_slice` has been removed. The CHANGELOG recommends using
    `toml::from_str` instead and doing the byte-to-str conversion yourself.
    
    The `toml::toml!` macro has also changed to return the type of the
    value declared within the macro body. In the change in
    `helix-view/src/theme.rs` this is a `toml::map::Map` (it was a
    `toml::Value` previously) allowing us to skip the match and use the
    map directly.
    
    Co-authored-by: Pascal Kuthe <[email protected]>
    the-mikedavis and pascalkuthe committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    21771b2 View commit details
    Browse the repository at this point in the history
  3. Refactor toml::Value->Theme conversion

    The `From<Value>` implementation for `Theme` converted the Value to a
    string and re-parsed the string to convert it to
    `HashMap<String, Value>` which feels a bit wasteful. This change uses
    the underlying `toml::map::Map` directly when the value is a table and
    warns about the unexpected `Value` shape otherwise.
    
    This is necessary because toml 0.6.0 changes the Display implementation
    for Value::Table so that the `to_string` no longer encodes the value as
    a Document, just a Value. So the parse of the Value fails to be decoded
    as a HashMap.
    
    The behavior for returning `Default::default` matches the previous
    code's behavior except that it did not warn when the input Value was
    failed to parse.
    the-mikedavis committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    c546883 View commit details
    Browse the repository at this point in the history
  4. refactor: don't deserialize &str from toml

    The new version of the `toml` crate is based on `toml_edit` and does
    not support zero copy deserialization anymore. So we need to deserialize
    `String` instead of `&str` in the keympa
    pascalkuthe authored and the-mikedavis committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    a8cdc63 View commit details
    Browse the repository at this point in the history