Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid import add #858

Merged
merged 3 commits into from Oct 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/analysis/functions.rs
Expand Up @@ -584,7 +584,9 @@ fn analyze_function(
func.c_identifier.as_ref().unwrap()
);
if let Ok(s) = used_rust_type(env, par.typ, !par.direction.is_out()) {
used_types.push(s);
if !s.ends_with("GString") || par.c_type == "gchar***" {
used_types.push(s);
}
}
let (to_glib_extra, callback_info) =
bounds.add_for_parameter(env, func, par, r#async, library::Concurrency::None);
Expand Down Expand Up @@ -977,10 +979,8 @@ fn analyze_callback(
}
}
if let Ok(s) = used_rust_type(env, func.ret.typ, false) {
if s != "GString" {
if !s.ends_with("GString") {
imports_to_add.push(s);
} else {
imports_to_add.push("String".to_owned());
}
}
let user_data_index = par.user_data_index.unwrap_or_else(|| 0);
Expand Down