Open Bug 1465381 Opened 2 years ago Updated 2 years ago

Make use of nicer match bindings for references

Categories

(Testing :: geckodriver, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

()

Details

With Rust 1.26 we got nicer match bindings. For details see the URL field.

What looks kinda helpful is that it can be simplified a lot when using a reference. Here an example:

Before: 

> impl ToJson for NullActionItem {
>     fn to_json(&self) -> Json {
>         match self {
>             &NullActionItem::General(ref x) => x.to_json(),
>         }
>     }
> }

After:

> impl ToJson for NullActionItem {
>     fn to_json(&self) -> Json {
>         match self {
>             NullActionItem::General(x) => x.to_json(),
>         }
>     }
> }

A separate bug can be filed for mozbase-rust crates.
Priority: -- → P3
Depends on: 1487989
You need to log in before you can comment on or make changes to this bug.