Rust: making function a method handled poorly
before
impl X {
fn x() {}
}
fn y() {
match () {
_ => y(),
};
}
after
impl X {
fn x() {}
fn y() {
match () {
_ => X::y(),
};
}
}
Freshly built off master
I think it would be better here if the fn on line 2 of the second file was highlighted, rather than the fn on line 4.
Showing impl X as red/green is kinda unavoidable, as difftastic is taking the view that the y function is largely unchanged and the impl is changed, because the y function is bigger.
This is also a good example of where highlighting moves would help, but we have #508 for that.
Wouldn't the optimal diff be not to highlight fn x() {} and only highlight X:: and the moved }? You mentioned some limitations around highlighting impl X but I don't understand why any fn should be highlighted in this diff.