gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
236 stars 107 forks source link

analysis: Prefer using glib::prelude::* #1415

Closed bilelmoussaoui closed 1 year ago

bilelmoussaoui commented 1 year ago

Reduce the amount of generated code and drops a bit of unneeded complexity

Fixes #1401

bilelmoussaoui commented 1 year ago

When applied to gtk4-rs 581 insertions(+), 1574 deletions(-)

bilelmoussaoui commented 1 year ago

I am also looking at grouping those kind of imports, that would simplify things a bit further

use crate::Accessible;
use crate::AccessibleRole;
use crate::Align;
use crate::Buildable;
use crate::ConstraintTarget;
use crate::Editable;
use crate::LayoutManager;
use crate::Overflow;
use crate::Widget;
sdroege commented 1 year ago

I am also looking at grouping those kind of imports, that would simplify things a bit further

use crate::Accessible;
use crate::AccessibleRole;
use crate::Align;
use crate::Buildable;
use crate::ConstraintTarget;
use crate::Editable;
use crate::LayoutManager;
use crate::Overflow;
use crate::Widget;

You could post-process them to make them all crate::{....}

bilelmoussaoui commented 1 year ago

I am also looking at grouping those kind of imports, that would simplify things a bit further

use crate::Accessible;
use crate::AccessibleRole;
use crate::Align;
use crate::Buildable;
use crate::ConstraintTarget;
use crate::Editable;
use crate::LayoutManager;
use crate::Overflow;
use crate::Widget;

You could post-process them to make them all crate::{....}

yes that is what i am planning to do, in a different PR though :)