Skip to content

Commit

Permalink
Merge pull request #43 from jerel/bugfix
Browse files Browse the repository at this point in the history
Release 0.9.6
  • Loading branch information
jerel authored Jul 21, 2023
2 parents 15d5cb1 + f755eb9 commit 0b8b35c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion membrane/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "membrane"
readme = "../README.md"
repository = "https://github.com/jerel/membrane"
rust-version = "1.61"
version = "0.9.5"
version = "0.9.6"

[lib]
crate-type = ["lib"]
Expand Down
2 changes: 1 addition & 1 deletion membrane_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "A companion crate for `membrane`"
edition = "2018"
license = "Apache-2.0"
name = "membrane_macro"
version = "0.7.0"
version = "0.7.1"

[lib]
proc-macro = true
Expand Down
2 changes: 2 additions & 0 deletions membrane_macro/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub fn parse_return_type(input: ParseStream) -> Result<(OutputStyle, syn::Type,
fn parse_type(input: ParseStream) -> Result<(syn::Type, syn::Type)> {
let outer_span = input.span();
let type_path = input.parse::<syn::TypePath>()?;
// if the formatter inserts a trailing comma on multi-line types then discard it
let _ = input.parse::<Token![,]>();
let return_type = &type_path.path.segments.last().unwrap();
if return_type.ident != "Result" {
return Err(Error::new(outer_span, "expected enum `Result`"));
Expand Down
4 changes: 2 additions & 2 deletions membrane_types/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ pub fn flatten_types(ty: &syn::Type, mut types: Vec<String>) -> syn::Result<Vec<
fn rust_c_type(ty: &[&str], type_: &syn::Type) -> syn::Result<TokenStream2> {
let result = match ty[..] {
["String"] => q!(*const ::std::os::raw::c_char),
["i64"] => q!(::std::os::raw::c_long),
["i64"] => q!(::std::os::raw::c_longlong),
["f64"] => q!(::std::os::raw::c_double),
["bool"] => q!(::std::os::raw::c_char), // i8
["Vec", ..] => q!(*const u8),
[serialized] if serialized != "Option" => q!(*const u8),
["Option", "String"] => q!(*const ::std::os::raw::c_char),
["Option", "i64"] => q!(*const ::std::os::raw::c_long),
["Option", "i64"] => q!(*const ::std::os::raw::c_longlong),
["Option", "f64"] => q!(*const ::std::os::raw::c_double),
["Option", "bool"] => q!(*const ::std::os::raw::c_char), // i8
["Option", ..] => q!(*const u8),
Expand Down

0 comments on commit 0b8b35c

Please sign in to comment.