Skip to content

Commit c28f5ca

Browse files
committed
Add missing error and panic docs
1 parent 5609661 commit c28f5ca

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<A: BlockArguments, R: EncodeReturn> Block<A, R> {
116116
let ptr: *const Self = self;
117117
let layout = unsafe { ptr.cast::<ffi::Block_layout>().as_ref().unwrap_unchecked() };
118118
// TODO: Is `invoke` actually ever null?
119-
let invoke = layout.invoke.unwrap();
119+
let invoke = layout.invoke.unwrap_or_else(|| unreachable!());
120120

121121
unsafe { A::__call_block(invoke, ptr as *mut Self, args) }
122122
}

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
#![deny(unsafe_op_in_unsafe_fn)]
8585
#![warn(clippy::cargo)]
8686
#![warn(clippy::ptr_as_ptr)]
87+
#![warn(clippy::missing_errors_doc)]
88+
#![warn(clippy::missing_panics_doc)]
8789
// Update in Cargo.toml as well.
8890
#![doc(html_root_url = "https://docs.rs/block2/0.3.0")]
8991

0 commit comments

Comments
 (0)