pub fn while_changing<T, F>(value: T, func: F) -> TExpand description
Applies a transformation to a given expression until a fix point is reached.
§Arguments
value- The initial value to transformfunc- The transformation function
§Returns
The transformed value when it stops changing
§Example
use polyglot_sql::helper::while_changing;
// Example: keep dividing by 2 until odd
let result = while_changing(16, |n| if n % 2 == 0 { n / 2 } else { n });
assert_eq!(result, 1);