Skip to content

Correctly generate glib::Error import#863

Merged
EPashkin merged 1 commit into
gtk-rs:masterfrom
GuillaumeGomez:correct-error-import
Oct 23, 2019
Merged

Correctly generate glib::Error import#863
EPashkin merged 1 commit into
gtk-rs:masterfrom
GuillaumeGomez:correct-error-import

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Comment thread src/analysis/imports.rs Outdated
fn strip_crate_name<'a>(&self, name: &'a str) -> Option<&'a str> {
fn strip_crate_name<'a>(&self, mut name: &'a str) -> Option<&'a str> {
if name == "Error" && self.crate_name != "glib" {
name = "glib::Error";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem correct. Why does it even end up here without the glib:: prefix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually an excellent question. Since it's part of manual imports everytime, it *should* not be needed. This fix is therefore incomplete. I need to find what's going on.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

I now extended the fix. Way cleaner, better, faster, etc. :)

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And now with fixed formatting.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

ping @EPashkin @sdroege :)

@EPashkin

Copy link
Copy Markdown
Member

@GuillaumeGomez Thanks, I will wait for @sdroege just in case

@sdroege

sdroege commented Oct 23, 2019

Copy link
Copy Markdown
Member

👍

@EPashkin EPashkin merged commit 2bb6380 into gtk-rs:master Oct 23, 2019
@GuillaumeGomez GuillaumeGomez deleted the correct-error-import branch October 23, 2019 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glib::Error gets used as use Error instead of use glib::Error when in the manual array

3 participants