Skip to content

Unreachable code fault at config-0.14.0/src/file/format/yaml.rs:53:26 #547

@mjaakkol

Description

@mjaakkol

I'm getting above error as

thread 'XXX' panicked at /home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/config-0.14.0/src/file/format/yaml.rs:53:26:
internal error: entered unreachable code

Yaml file looks like

link:
  null:
    name: "null"
  tcp:
    address: "localhost:1234"

My structure definitions for the section are:

#[derive(serde::Deserialize, Clone)]
pub struct LinkSettings {
    pub serial: Option<SerialSettings>,
    pub unix: Option<UnixSettings>,
    pub null: Option<NullSettings>,
    pub tcp: Option<TcpSettings>,
}

#[derive(serde::Deserialize, Clone)]
pub struct NullSettings {
    pub name: String,
}

#[derive(serde::Deserialize, Clone)]
pub struct UnixSettings {
    pub name: String,
}

#[derive(serde::Deserialize, Clone)]
pub struct TcpSettings {
    pub address: String,
}

I believe above is valid yaml (not the best looking yaml but I'll add more things to the hashtable later so the structure is needed. This worked with 0.13.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions