Skip to content

Commit

Permalink
use #[non_exhaustive] on RangeOption and generated enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Speedy37 committed Mar 13, 2020
1 parent 24ed042 commit f1aeccd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Clikengo/foundationdb-rs/CI)](https://github.com/Clikengo/foundationdb-rs/actions)
[![Codecov](https://img.shields.io/codecov/c/github/Clikengo/foundationdb-rs)](https://codecov.io/gh/Clikengo/foundationdb-rs)
![Rustc 1.39+](https://img.shields.io/badge/rustc-1.39+-lightgrey)
![Rustc 1.40+](https://img.shields.io/badge/rustc-1.40+-lightgrey)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=Clikengo/foundationdb-rs)](https://dependabot.com)

# FoundationDB Rust Client
Expand All @@ -13,7 +13,7 @@ The repo consists of multiple crates
| [**foundationdb-sys**](foundationdb-sys/README.md) | [![Crates.io](https://img.shields.io/crates/v/foundationdb-sys)](https://crates.io/crates/foundationdb-sys) [![foundationdb-sys](https://docs.rs/foundationdb-sys/badge.svg)](https://docs.rs/foundationdb-sys) | C API bindings for FoundationDB |
| **foundationdb-gen** | n/a | Code generator for common options and types of FoundationDB |

The current version requires rustc 1.39+ to work (async/await feature).
The current version requires rustc 1.40+ to work (async/await feature).
The previous version (0.3) is still maintained and is available within the 0.3 branch.

You can access the `master` branch documentation [here](https://clikengo.github.io/foundationdb-rs/foundationdb/index.html).
Expand Down
1 change: 1 addition & 0 deletions foundationdb-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ impl FdbScope {
} else {
writeln!(w, "#[derive(Clone, Copy, Debug)]")?;
}
writeln!(w, "#[non_exhaustive]")?;
writeln!(w, "pub enum {name} {{", name = self.name)?;

let with_ty = self.with_ty();
Expand Down
2 changes: 1 addition & 1 deletion foundationdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a wrapper library around the FoundationDB (Fdb) C API. It implements fut

## Prerequisites

Rust 1.39+
Rust 1.40+

### Install FoundationDB

Expand Down
4 changes: 1 addition & 3 deletions foundationdb/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ fn fdb_limit(v: usize) -> std::os::raw::c_int {
/// };
/// ```
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct RangeOption<'a> {
/// The beginning of the range.
pub begin: KeySelector<'a>,
Expand All @@ -231,8 +232,6 @@ pub struct RangeOption<'a> {
/// If true, key-value pairs will be returned in reverse lexicographical order beginning at
/// the end of the range.
pub reverse: bool,
#[doc(hidden)]
pub __non_exhaustive: std::marker::PhantomData<()>,
}

impl<'a> RangeOption<'a> {
Expand Down Expand Up @@ -275,7 +274,6 @@ impl<'a> Default for RangeOption<'a> {
target_bytes: 0,
mode: options::StreamingMode::Iterator,
reverse: false,
__non_exhaustive: std::marker::PhantomData,
}
}
}
Expand Down

0 comments on commit f1aeccd

Please sign in to comment.