summaryrefslogtreecommitdiffstats
path: root/toolkit/components/uniffi-bindgen-gecko-js/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/uniffi-bindgen-gecko-js/src/render')
-rw-r--r--toolkit/components/uniffi-bindgen-gecko-js/src/render/cpp.rs40
-rw-r--r--toolkit/components/uniffi-bindgen-gecko-js/src/render/js.rs4
2 files changed, 19 insertions, 25 deletions
diff --git a/toolkit/components/uniffi-bindgen-gecko-js/src/render/cpp.rs b/toolkit/components/uniffi-bindgen-gecko-js/src/render/cpp.rs
index 685c3c2bf3..7b63e8f3af 100644
--- a/toolkit/components/uniffi-bindgen-gecko-js/src/render/cpp.rs
+++ b/toolkit/components/uniffi-bindgen-gecko-js/src/render/cpp.rs
@@ -136,31 +136,25 @@ pub impl FfiType {
// Type for the Rust scaffolding code
fn rust_type(&self) -> String {
match self {
- FfiType::UInt8 => "uint8_t",
- FfiType::Int8 => "int8_t",
- FfiType::UInt16 => "uint16_t",
- FfiType::Int16 => "int16_t",
- FfiType::UInt32 => "uint32_t",
- FfiType::Int32 => "int32_t",
- FfiType::UInt64 => "uint64_t",
- FfiType::Int64 => "int64_t",
- FfiType::Float32 => "float",
- FfiType::Float64 => "double",
- FfiType::RustBuffer(_) => "RustBuffer",
- FfiType::RustArcPtr(_) => "void *",
- FfiType::ForeignCallback => "ForeignCallback",
+ FfiType::UInt8 => "uint8_t".to_owned(),
+ FfiType::Int8 => "int8_t".to_owned(),
+ FfiType::UInt16 => "uint16_t".to_owned(),
+ FfiType::Int16 => "int16_t".to_owned(),
+ FfiType::UInt32 => "uint32_t".to_owned(),
+ FfiType::Int32 => "int32_t".to_owned(),
+ FfiType::UInt64 => "uint64_t".to_owned(),
+ FfiType::Int64 => "int64_t".to_owned(),
+ FfiType::Float32 => "float".to_owned(),
+ FfiType::Float64 => "double".to_owned(),
+ FfiType::RustBuffer(_) => "RustBuffer".to_owned(),
+ FfiType::RustArcPtr(_) => "void *".to_owned(),
FfiType::ForeignBytes => unimplemented!("ForeignBytes not supported"),
- FfiType::ForeignExecutorHandle => unimplemented!("ForeignExecutorHandle not supported"),
- FfiType::ForeignExecutorCallback => {
- unimplemented!("ForeignExecutorCallback not supported")
- }
- FfiType::RustFutureHandle
- | FfiType::RustFutureContinuationCallback
- | FfiType::RustFutureContinuationData => {
- unimplemented!("Rust async functions not supported")
- }
+ FfiType::Handle => "uint64_t".to_owned(),
+ FfiType::RustCallStatus => "RustCallStatus".to_owned(),
+ FfiType::Callback(name) | FfiType::Struct(name) => name.to_owned(),
+ FfiType::VoidPointer => "void *".to_owned(),
+ FfiType::Reference(_) => unimplemented!("References not supported"),
}
- .to_owned()
}
}
diff --git a/toolkit/components/uniffi-bindgen-gecko-js/src/render/js.rs b/toolkit/components/uniffi-bindgen-gecko-js/src/render/js.rs
index efd7b42456..cd9af529a7 100644
--- a/toolkit/components/uniffi-bindgen-gecko-js/src/render/js.rs
+++ b/toolkit/components/uniffi-bindgen-gecko-js/src/render/js.rs
@@ -92,7 +92,8 @@ pub impl Literal {
Literal::Enum(name, typ) => render_enum_literal(typ, name),
Literal::EmptyMap => "{}".to_string(),
Literal::EmptySequence => "[]".to_string(),
- Literal::Null => "null".to_string(),
+ Literal::Some { inner } => inner.render(),
+ Literal::None => "null".to_string(),
}
}
}
@@ -258,7 +259,6 @@ pub impl Type {
| Type::CallbackInterface { name, .. } => format!("Type{name}"),
Type::Timestamp => "Timestamp".into(),
Type::Duration => "Duration".into(),
- Type::ForeignExecutor => "ForeignExecutor".into(),
Type::Optional { inner_type } => format!("Optional{}", inner_type.canonical_name()),
Type::Sequence { inner_type } => format!("Sequence{}", inner_type.canonical_name()),
Type::Map {