Skip to content

Commit 88a1eb1

Browse files
committed
Use non_exhaustive for Conf
1 parent 929fa1a commit 88a1eb1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/target
22
Cargo.lock
33
.idea/
4-
exe/
4+
bin/

src/lib.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ pub use bitcoind;
2424
/// Electrs configuration parameters, implements a convenient [Default] for most common use.
2525
///
2626
/// Default values:
27-
/// ```no_run
28-
/// electrsd::Conf {
29-
/// args: vec!["-vvv", "--txid-limit=0"],
30-
/// view_stderr: false,
31-
/// http_enabled: false,
32-
/// network: "regtest",
33-
/// };
3427
/// ```
28+
/// let mut conf = electrsd::Conf::default();
29+
/// conf.args = vec!["-vvv"];
30+
/// conf.view_stderr = false;
31+
/// conf.http_enabled = false;
32+
/// conf.network = "regtest";
33+
/// assert_eq!(conf, electrsd::Conf::default());
34+
/// ```
35+
#[derive(Debug, PartialEq)]
36+
#[non_exhaustive]
3537
pub struct Conf<'a> {
3638
/// Electrsd command line arguments
3739
/// note that `db-dir`, `cookie`, `cookie-file`, `daemon-rpc-addr`, `jsonrpc-import`, `electrum-rpc-addr`, `monitoring-addr`, `http-addr` cannot be used cause they are automatically initialized.

0 commit comments

Comments
 (0)