i3ipc-rs icon indicating copy to clipboard operation
i3ipc-rs copied to clipboard

Add struct for rects?

Open acheronfail opened this issue 5 years ago • 0 comments

I'm just seeing if there's any interest in creating a struct to wrap the rects received from i3. Ideally these:

https://github.com/tmerr/i3ipc-rs/blob/master/src/reply.rs#L211

Could be changed to something along the lines of:

struct Rect {
    top: i32,
    left: i32,
    width: i32,
    height: i32,
}

Which would make things like:

let height = node.rect.3;

Become much more readable:

let height = node.rect.height;

I'm more than happy to create a PR with these changes if that's something that we can do.

acheronfail avatar Feb 07 '20 23:02 acheronfail