mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-15 05:51:23 +00:00
Fixing compile errors
This commit is contained in:
@ -162,12 +162,12 @@ impl Descriptor {
|
|||||||
|
|
||||||
pub fn vector_kind(&self) -> Option<VectorKind> {
|
pub fn vector_kind(&self) -> Option<VectorKind> {
|
||||||
let inner = match *self {
|
let inner = match *self {
|
||||||
Descriptor::String => return Some(VectorKind::String),
|
Descriptor::String | Descriptor::CachedString => return Some(VectorKind::String),
|
||||||
Descriptor::Vector(ref d) => &**d,
|
Descriptor::Vector(ref d) => &**d,
|
||||||
Descriptor::Slice(ref d) => &**d,
|
Descriptor::Slice(ref d) => &**d,
|
||||||
Descriptor::Ref(ref d) => match **d {
|
Descriptor::Ref(ref d) => match **d {
|
||||||
Descriptor::Slice(ref d) => &**d,
|
Descriptor::Slice(ref d) => &**d,
|
||||||
Descriptor::String => return Some(VectorKind::String),
|
Descriptor::String | Descriptor::CachedString => return Some(VectorKind::String),
|
||||||
_ => return None,
|
_ => return None,
|
||||||
},
|
},
|
||||||
Descriptor::RefMut(ref d) => match **d {
|
Descriptor::RefMut(ref d) => match **d {
|
||||||
|
@ -211,7 +211,7 @@ impl IncomingBuilder {
|
|||||||
Descriptor::RefMut(d) => self.process_ref(true, d)?,
|
Descriptor::RefMut(d) => self.process_ref(true, d)?,
|
||||||
Descriptor::Option(d) => self.process_option(d)?,
|
Descriptor::Option(d) => self.process_option(d)?,
|
||||||
|
|
||||||
Descriptor::String | Descriptor::Vector(_) => {
|
Descriptor::String | Descriptor::CachedString | Descriptor::Vector(_) => {
|
||||||
let kind = arg.vector_kind().ok_or_else(|| {
|
let kind = arg.vector_kind().ok_or_else(|| {
|
||||||
format_err!("unsupported argument type for calling Rust function from JS {:?}", arg)
|
format_err!("unsupported argument type for calling Rust function from JS {:?}", arg)
|
||||||
})? ;
|
})? ;
|
||||||
@ -256,7 +256,7 @@ impl IncomingBuilder {
|
|||||||
self.bindings
|
self.bindings
|
||||||
.push(NonstandardIncoming::BorrowedAnyref { val: expr });
|
.push(NonstandardIncoming::BorrowedAnyref { val: expr });
|
||||||
}
|
}
|
||||||
Descriptor::String | Descriptor::Slice(_) => {
|
Descriptor::String | Descriptor::CachedString | Descriptor::Slice(_) => {
|
||||||
let kind = arg.vector_kind().ok_or_else(|| {
|
let kind = arg.vector_kind().ok_or_else(|| {
|
||||||
format_err!(
|
format_err!(
|
||||||
"unsupported slice type for calling Rust function from JS {:?}",
|
"unsupported slice type for calling Rust function from JS {:?}",
|
||||||
@ -363,7 +363,7 @@ impl IncomingBuilder {
|
|||||||
self.webidl.push(ast::WebidlScalarType::Any);
|
self.webidl.push(ast::WebidlScalarType::Any);
|
||||||
}
|
}
|
||||||
|
|
||||||
Descriptor::String | Descriptor::Vector(_) => {
|
Descriptor::String | Descriptor::CachedString | Descriptor::Vector(_) => {
|
||||||
let kind = arg.vector_kind().ok_or_else(|| {
|
let kind = arg.vector_kind().ok_or_else(|| {
|
||||||
format_err!(
|
format_err!(
|
||||||
"unsupported optional slice type for calling Rust function from JS {:?}",
|
"unsupported optional slice type for calling Rust function from JS {:?}",
|
||||||
|
@ -60,7 +60,7 @@ pub enum NonstandardOutgoing {
|
|||||||
kind: VectorKind,
|
kind: VectorKind,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// A Rust String (or &str) which might be cached, and might be `None`.
|
/// A Rust String (or &str) which might be cached, or might be `None`.
|
||||||
///
|
///
|
||||||
/// If `offset` is 0 then it is cached, and the cached JsValue's index is in `length`.
|
/// If `offset` is 0 then it is cached, and the cached JsValue's index is in `length`.
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user