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

rename_all attribute does not work #53

Open
AtsukiTak opened this issue Jan 4, 2021 · 1 comment
Open

rename_all attribute does not work #53

AtsukiTak opened this issue Jan 4, 2021 · 1 comment

Comments

@AtsukiTak
Copy link

AtsukiTak commented Jan 4, 2021

🐛 Bug description

When I use #[serde(rename_all = "camelCase")] attribute, envy seems to unable to find target variable.
I tried another case such as SCREAMING_SNAKE_CASE but it also fails.

#[derive(Deserialize, PartialEq, Debug)]
#[serde(rename_all = "camelCase")]
struct Bar {
    hoge_hoge: String
}

#[test]
fn deserialize_with_rename_all() {
    let data = vec![(String::from("hogeHoge"), String::from("yey"))];
    
    // it returns "Err(MissingValue("hogeHoge"))"
    from_iter::<_, Bar>(data);
}

🤔 Expected Behavior

envy should find corresponding environmental variable.

👟 Steps to reproduce

#[derive(Deserialize, PartialEq, Debug)]
#[serde(rename_all = "camelCase")]
struct Bar {
    hoge_hoge: String
}

#[test]
fn deserialize_with_rename_all() {
    let data = vec![(String::from("hogeHoge"), String::from("yey"))];
    
    // it returns "Err(MissingValue("hogeHoge"))"
    from_iter::<_, Bar>(data);
}

🌍 Your environment

macOS 10.15.6
rustc 1.47.0
envy version: 0.4.2

@AtsukiTak
Copy link
Author

maybe it's relevant to #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant