Skip to content

Commit c4c0dc2

Browse files
author
Joshua Nelson
committed
Fix nightly warnings
These will hit stable in about 6 weeks, it's nice to fix them early. Note that this does not fix `clippy::upper_case_acronyms` since doing so would be a breaking change. See rust-lang/rust-clippy#6803 for more details. Here are the warnings that were previously emitted: ``` warning: unnecessary trailing semicolon --> src/simple_api/mod.rs:1172:10 | 1172 | }; | ^ help: remove this semicolon | = note: `#[warn(redundant_semicolons)]` on by default warning: panic message is not a string literal --> examples/threenp1.rs:127:30 | 127 | Err(x) => panic!(x), | ^ | = note: `#[warn(non_fmt_panic)]` on by default = note: this is no longer accepted in Rust 2021 help: add a "{}" format string to Display the message | 127 | Err(x) => panic!("{}", x), | ^^^^^ help: or use std::panic::panic_any instead | 127 | Err(x) => std::panic::panic_any(x), | ^^^^^^^^^^^^^^^^^^^^^^ error: name `YDB` contains a capitalized acronym --> src/context_api/mod.rs:747:5 | 747 | YDB(YDBError), | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ydb` | = note: `-D clippy::upper-case-acronyms` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms ```
1 parent 9ae2c90 commit c4c0dc2

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

examples/threenp1.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************
22
* *
3-
* Copyright (c) 2019-2020 YottaDB LLC and/or its subsidiaries. *
3+
* Copyright (c) 2019-2021 YottaDB LLC and/or its subsidiaries. *
44
* All rights reserved. *
55
* *
66
* This source code contains the intellectual property *
@@ -122,10 +122,7 @@ fn main() -> Result<(), Box<dyn Error>> {
122122
let start_time = SystemTime::now();
123123
// Wait for them to finish
124124
end_barrier.wait();
125-
let time = match start_time.elapsed() {
126-
Ok(elapsed) => elapsed.as_millis(),
127-
Err(x) => panic!(x),
128-
} as f64;
125+
let time = start_time.elapsed().unwrap().as_millis() as f64;
129126

130127
let updt = updates.get()?;
131128
let updt = String::from_utf8_lossy(&updt);

src/simple_api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ impl Key {
11691169
// SAFETY: This is only written to by `ydb_next_subscript` or `ydb_prev_subscript`, which only write variable names, not arbitrary data.
11701170
// Since variable names are always ASCII, this is sound.
11711171
this.subscripts.last_mut().unwrap_or(this.variable.as_mut_vec())
1172-
};
1172+
}
11731173

11741174
let status = loop {
11751175
// NOTE: this can't be hoisted out of the loop because the variable or subscripts could be resized on INVSTRLEN.

0 commit comments

Comments
 (0)