Skip to content

fix unused_assignments warning#18

Open
johann-cm wants to merge 1 commit intonamib-project:mainfrom
johann-cm:fix_unused_assignments
Open

fix unused_assignments warning#18
johann-cm wants to merge 1 commit intonamib-project:mainfrom
johann-cm:fix_unused_assignments

Conversation

@johann-cm
Copy link
Copy Markdown
Contributor

cargo test was reporting a warning on unused assignments on e3:

error: value assigned to `e3` is never read
Error:    --> libuci-sys/src/lib.rs:217:9
    |
217 |         e3.list.prev = &raw mut e2.list;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: maybe it is overwritten before being read?
    = note: `-D unused-assignments` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_assignments)]`

error: value assigned to `e3` is never read
Error:    --> libuci-sys/src/lib.rs:218:9
    |
218 |         e3.list.next = &raw mut head;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: maybe it is overwritten before being read?

error: value assigned to `e3` is never read
Error:    --> libuci-sys/src/lib.rs:219:9
    |
219 |         e3.type_ = 3;
    |         ^^^^^^^^^^^^
    |
    = help: maybe it is overwritten before being read?

I guess the compiler does not understand the linked list with raw pointers very well.
Technically, only e3 needed to be renamed, but I renamed e1, e2, e3 for consistency.

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.

1 participant