Skip to content

Commit 0190eea

Browse files
committed
Review comments
1 parent 6f73683 commit 0190eea

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
wasmtime (19.0.0)
5-
rb_sys (~> 0.9.86)
5+
rb_sys (~> 0.9.97)
66

77
GEM
88
remote: https://rubygems.org/

ext/src/ruby_api/convert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ impl ToExtern for Value {
127127
}
128128

129129
pub trait ToSym {
130-
fn as_sym(&self) -> Result<Symbol, Error>;
130+
fn to_sym(&self) -> Result<Symbol, Error>;
131131
}
132132

133133
impl ToSym for ValType {
134-
fn as_sym(&self) -> Result<Symbol, Error> {
134+
fn to_sym(&self) -> Result<Symbol, Error> {
135135
if self.matches(&ValType::EXTERNREF) {
136136
return Ok(Symbol::from(*EXTERNREF));
137137
}
@@ -152,7 +152,7 @@ impl ToSym for ValType {
152152
}
153153

154154
impl ToSym for RefType {
155-
fn as_sym(&self) -> Result<Symbol, Error> {
155+
fn to_sym(&self) -> Result<Symbol, Error> {
156156
if self.matches(&RefType::FUNCREF) {
157157
return Ok(Symbol::from(*FUNCREF));
158158
}

ext/src/ruby_api/func.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ impl<'a> Func<'a> {
136136
let len = ty.params().len();
137137
let mut params = ty.params();
138138
params.try_fold(RArray::with_capacity(len), |array, p| {
139-
array.push(p.as_sym()?).map_err(|e| error!("{e}"))?;
140-
Ok::<_, Error>(array)
139+
array.push(p.to_sym()?)?;
140+
Ok(array)
141141
})
142142
}
143143

@@ -148,8 +148,8 @@ impl<'a> Func<'a> {
148148
let len = ty.results().len();
149149
let mut results = ty.results();
150150
results.try_fold(RArray::with_capacity(len), |array, r| {
151-
array.push(r.as_sym()?).map_err(|e| error!("{e}"))?;
152-
Ok::<_, Error>(array)
151+
array.push(r.to_sym()?)?;
152+
Ok(array)
153153
})
154154
}
155155

ext/src/ruby_api/global.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl<'a> Global<'a> {
9595
/// @def type
9696
/// @return [Symbol] The Wasm type of the global‘s content.
9797
pub fn type_(&self) -> Result<Symbol, Error> {
98-
self.ty()?.content().as_sym()
98+
self.ty()?.content().to_sym()
9999
}
100100

101101
/// @yard

ext/src/ruby_api/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a> Table<'a> {
8989
/// @def type
9090
/// @return [Symbol] The Wasm type of the elements of this table.
9191
pub fn type_(&self) -> Result<Symbol, Error> {
92-
self.ty()?.element().as_sym()
92+
self.ty()?.element().to_sym()
9393
}
9494

9595
/// @yard

0 commit comments

Comments
 (0)