rust-tools.nvim
rust-tools.nvim copied to clipboard
Inlay hints is giving wrong hints for recursive functions
Problem
Inlay hints is not giving proper hints for recursive functions
Actual
fn quick_sort(array: &mut Vec<i64>, low: usize, high: usize) {
let pivot = partition(array, low, high); => usize
quick_sort(array, low, pivot.checked_sub(1).unwrap_or(0)); <- (high, default)
quick_sort(array, pivot + 1, high); <- (low)
}
Expected
fn quick_sort(array: &mut Vec<i64>, low: usize, high: usize) {
let pivot = partition(array, low, high); => usize
quick_sort(array, low, pivot.checked_sub(1).unwrap_or(0)); <- (array, low, high)
quick_sort(array, pivot + 1, high); <- (array, low, high)
}