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

Allow struct fields be named as 'name' (issue #21) #29

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

DmitrySamoylov
Copy link
Contributor

Hey everyone!

To prevent clashing I extended names of internal mut variables used for field initialization

For example after cargo expand:
Before (was clashing with XmlNode::SomeType { name, .. }):

#[allow(unused_mut)]
let mut name: String = "".to_string();

...

if let Ok(value) = result {
  name = value
}

...

Ok(Book { name: name })

After:

#[allow(unused_mut)]
let mut __name_value: String = "".to_string();

...

if let Ok(value) = result {
  __name_value = value
}

...

Ok(Book { name: __name_value })

Issue #21

@coveralls
Copy link

Pull Request Test Coverage Report for Build 93

  • 11 of 23 (47.83%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 36.549%

Changes Missing Coverage Covered Lines Changed/Added Lines %
yaserde_derive/src/de/expand_struct.rs 0 12 0.0%
Totals Coverage Status
Change from base Build 92: 0.2%
Covered Lines: 682
Relevant Lines: 1866

💛 - Coveralls

@MarcAntoine-Arnaud
Copy link
Contributor

thank you @DmitrySamoylov for the improvement !

@MarcAntoine-Arnaud MarcAntoine-Arnaud merged commit 90f19a3 into media-io:master Dec 10, 2019
@DmitrySamoylov DmitrySamoylov deleted the fix-name-issue branch February 5, 2020 07:38
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

Successfully merging this pull request may close these issues.

None yet

3 participants