Skip to content

Commit d33a0c6

Browse files
chore: enable unnecessarily disabled clippy rules
(detection has been fixed upstream) Signed-off-by: Henry Gressmann <[email protected]>
1 parent ad47fb7 commit d33a0c6

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

crates/tinywasm/src/interpreter/values.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(missing_docs)]
21
use crate::Result;
32
use tinywasm_types::{LocalAddr, ValType, WasmValue};
43

@@ -12,9 +11,13 @@ pub(crate) type ValueRef = Option<u32>;
1211
#[derive(Debug, Clone, Copy, PartialEq)]
1312
/// A untyped WebAssembly value
1413
pub enum TinyWasmValue {
14+
/// A 32-bit value
1515
Value32(Value32),
16+
/// A 64-bit value
1617
Value64(Value64),
18+
/// A 128-bit value
1719
Value128(Value128),
20+
/// A reference value
1821
ValueRef(ValueRef),
1922
}
2023

@@ -64,34 +67,39 @@ impl From<&[ValType]> for StackHeight {
6467
}
6568

6669
impl TinyWasmValue {
70+
/// Asserts that the value is a 32-bit value and returns it (panics if the value is the wrong size)
6771
pub fn unwrap_32(&self) -> Value32 {
6872
match self {
6973
TinyWasmValue::Value32(v) => *v,
7074
_ => unreachable!("Expected Value32"),
7175
}
7276
}
7377

78+
/// Asserts that the value is a 64-bit value and returns it (panics if the value is the wrong size)
7479
pub fn unwrap_64(&self) -> Value64 {
7580
match self {
7681
TinyWasmValue::Value64(v) => *v,
7782
_ => unreachable!("Expected Value64"),
7883
}
7984
}
8085

86+
/// Asserts that the value is a 128-bit value and returns it (panics if the value is the wrong size)
8187
pub fn unwrap_128(&self) -> Value128 {
8288
match self {
8389
TinyWasmValue::Value128(v) => *v,
8490
_ => unreachable!("Expected Value128"),
8591
}
8692
}
8793

94+
/// Asserts that the value is a reference value and returns it (panics if the value is the wrong size)
8895
pub fn unwrap_ref(&self) -> ValueRef {
8996
match self {
9097
TinyWasmValue::ValueRef(v) => *v,
9198
_ => unreachable!("Expected ValueRef"),
9299
}
93100
}
94101

102+
/// Attaches a type to the value (panics if the size of the value is not the same as the type)
95103
pub fn attach_type(&self, ty: ValType) -> WasmValue {
96104
match ty {
97105
ValType::I32 => WasmValue::I32(self.unwrap_32() as i32),

crates/tinywasm/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
no_crate_inject,
44
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_assignments, unused_variables))
55
))]
6-
#![allow(unexpected_cfgs, clippy::reserve_after_initialization)]
76
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms, unreachable_pub)]
87
#![cfg_attr(feature = "nightly", feature(portable_simd))]
98
#![forbid(unsafe_code)]

crates/tinywasm/tests/testsuite/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(dead_code)] // rust analyzer doesn't recognize that code is used by tests without harness
2-
31
use eyre::Result;
42
use owo_colors::OwoColorize;
53
use std::io::{BufRead, Seek, SeekFrom};

examples/rust/src/fibonacci.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![no_main]
2-
#![allow(non_snake_case)]
32

43
#[no_mangle]
54
pub extern "C" fn fibonacci(n: i32) -> i32 {

0 commit comments

Comments
 (0)