tmerr / i3ipc-rs

A Rust library for controlling i3-wm through its IPC interface
MIT License
107 stars 33 forks source link

Add struct for rects? #53

Open acheronfail opened 4 years ago

acheronfail commented 4 years ago

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.