Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-261

Mark enums and options struct as non-exhaustible

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      In Rust 1.40, [the #[non_exhaustive] attribute was introduced|https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html#[non_exhaustive]-structs,-enums,-and-variants]. This attribute allows us to mark various structs and enums as needing a wildcard case when being constructed or pattern matched, which means that adding new cases to the ErrorKind enum or the FindOptions struct no longer break source compatibility.

      We should mark all appropriate structs and enums with this attribute.

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: