Skip to content

Commit

Permalink
Fix lint error from let_underscore_lock (#228)
Browse files Browse the repository at this point in the history
* Fix lint error from let_underscore_lock

* Nightly says to go back to ok_or_else

a2de8a9 did this because of the previous clippy error, and now it says hey go back to what it was :D

There is no way to make both versions happy, so for now I added allow() to suppress the stable one.
  • Loading branch information
saschanaz authored Oct 25, 2022
1 parent 7009980 commit 374a71d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ pub enum Type {
/// We use manual tagging, because <https://github.com/serde-rs/serde/issues/610>.
impl Type {
pub fn from_tag(tag: u8) -> Result<Type, DataError> {
Type::from_primitive(tag).ok_or(DataError::UnknownType(tag))
#![allow(clippy::unnecessary_lazy_evaluations)]
Type::from_primitive(tag).ok_or_else(|| DataError::UnknownType(tag))
}

#[allow(clippy::wrong_self_convention)]
Expand Down
4 changes: 2 additions & 2 deletions tests/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use rkv::{
fn test_simple() {
type Manager = rkv::Manager<LmdbEnvironment>;

let _ = Manager::singleton().write().unwrap();
let _unused = Manager::singleton().write().unwrap();
}

/// Test that a manager can be created with simple type inference.
Expand All @@ -35,7 +35,7 @@ fn test_simple() {
fn test_simple_safe() {
type Manager = rkv::Manager<SafeModeEnvironment>;

let _ = Manager::singleton().write().unwrap();
let _unused = Manager::singleton().write().unwrap();
}

/// Test that a shared Rkv instance can be created with simple type inference.
Expand Down

0 comments on commit 374a71d

Please sign in to comment.