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

Cleanup redundant field names in struct initialization. #564

Merged
merged 2 commits into from Mar 10, 2018
Merged

Cleanup redundant field names in struct initialization. #564

merged 2 commits into from Mar 10, 2018

Conversation

ghost
Copy link

@ghost ghost commented Mar 10, 2018

No description provided.

@EPashkin
Copy link
Member

Thanks, I was planing do this after your PR merged.
Please, also change this

warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
  --> src\custom_type_glib_priority.rs:47:20
   |
47 |         for par in func.parameters.iter_mut() {
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut func.parameters`
   |
   = note: #[warn(explicit_iter_loop)] on by default
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#explicit_iter_loop

warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
  --> src\visitors.rs:11:22
   |
11 |         for type_ in self.types.iter_mut() {
   |                      ^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut self.types`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#explicit_iter_loop

warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
  --> src\visitors.rs:25:59
   |
25 |             Type::Class(ref mut class) => for function in class.functions.iter_mut() {
   |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut class.functions`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#explicit_iter_loop

warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
  --> src\visitors.rs:30:67
   |
30 |             Type::Interface(ref mut interface) => for function in interface.functions.iter_mut() {
   |                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut interface.functions`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#explicit_iter_loop

warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
  --> src\visitors.rs:35:61
   |
35 |             Type::Record(ref mut record) => for function in record.functions.iter_mut() {
   |                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut record.functions`
   |
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#explicit_iter_loop

@EPashkin
Copy link
Member

Thanks, I will merge after CI passed.

@ghost
Copy link
Author

ghost commented Mar 10, 2018

FYI: The remaining warning about replacing end with end was fixed in clippy rust-lang/rust-clippy#2507, but appear to be unreleased yet.

@EPashkin
Copy link
Member

Yes, I just installed gir version of clippy, so I don't see this warning now.

@ghost ghost mentioned this pull request Mar 10, 2018
@EPashkin
Copy link
Member

@tmiasko Thanks again

@EPashkin EPashkin merged commit e51c812 into gtk-rs:master Mar 10, 2018
vhdirk pushed a commit to vhdirk/gir that referenced this pull request Jul 6, 2018
Cleanup redundant field names in struct initialization.
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.

2 participants