Skip to content

Commit

Permalink
Correctly generate child property getters/setters
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Jan 14, 2019
1 parent e9a60de commit f98d2c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/codegen/child_properties.rs
Expand Up @@ -90,7 +90,7 @@ fn declaration(env: &Env, prop: &ChildProperty, is_get: bool) -> String {
let func_name = format!("{}_{}_{}", get_set, prop.child_name, prop_name);
let mut bounds = if let Some(typ) = prop.child_type {
let child_type = rust_type(env, typ).into_string();
format!("T: IsA<{}> + IsA<Widget>", child_type)
format!("T: IsA<{}>", child_type)
} else {
"T: IsA<Widget>".to_string()
};
Expand Down
4 changes: 2 additions & 2 deletions src/codegen/property_body.rs
Expand Up @@ -87,7 +87,7 @@ impl Builder {
}

if self.is_child_property {
params.push(Chunk::Custom("item.to_glib_none().0".into()));
params.push(Chunk::Custom("item.to_glib_none().0 as *mut _".into()));
}
params.push(Chunk::Custom(format!("b\"{}\\0\".as_ptr() as *const _", self.name)));
params.push(Chunk::Custom("value.to_glib_none_mut().0".into()));
Expand Down Expand Up @@ -150,7 +150,7 @@ impl Builder {
}

if self.is_child_property {
params.push(Chunk::Custom("item.to_glib_none().0".into()));
params.push(Chunk::Custom("item.to_glib_none().0 as *mut _".into()));
}
params.push(Chunk::Custom(format!("b\"{}\\0\".as_ptr() as *const _", self.name)));
let ref_str = if self.is_ref { "" } else { "&" };
Expand Down

0 comments on commit f98d2c1

Please sign in to comment.