You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Returns n_1, b_1, n_2, b_2fndistribute(sum:u64) -> (u64,u64,u64,u64){letmut a = sum;// ...if a == 1{// ...}else{let kmax:u64 = a.ilog2().into();let pow_2_kmax:u64 = (2_i32.pow(kmax.try_into().expect("k_max could not convert into u32"))).try_into().expect("2^(k_max) could not convert to u64");return(kmax + 1 + m,1, a - pow_2_kmax + 1 + m, a - pow_2_kmax);}}
What I would expect:
/// Returns n_1, b_1, n_2, b_2fndistribute(sum:u64) -> (u64,u64,u64,u64){letmut a = sum;// ...if a == 1{// ...}else{let kmax:u64 = a.ilog2().into();let pow_2_kmax:u64 = (2_i32.pow(kmax.try_into().expect("k_max could not convert into u32"))).try_into().expect("2^(k_max) could not convert to u64");return(kmax + 1 + m,1, a - pow_2_kmax + 1 + m, a - pow_2_kmax);}}
There's something about wrapping 2_i32.pow(kmax.try_into().expect("k_max could not convert into u32")) in parens that's causing the issue. The following formats just fine:
Input
/// Returns n_1, b_1, n_2, b_2fndistribute(sum:u64) -> (u64,u64,u64,u64){letmut a = sum;// ...if a == 1{// ...}else{let kmax:u64 = a.ilog2().into();let pow_2_kmax:u64 = 2_i32.pow(kmax.try_into().expect("k_max could not convert into u32")).try_into().expect("2^(k_max) could not convert to u64");return(kmax + 1 + m,1, a - pow_2_kmax + 1 + m, a - pow_2_kmax);}}
Output
/// Returns n_1, b_1, n_2, b_2fndistribute(sum:u64) -> (u64,u64,u64,u64){letmut a = sum;// ...if a == 1{// ...}else{let kmax:u64 = a.ilog2().into();let pow_2_kmax:u64 = 2_i32.pow(kmax.try_into().expect("k_max could not convert into u32")).try_into().expect("2^(k_max) could not convert to u64");return(kmax + 1 + m,1, a - pow_2_kmax + 1 + m, a - pow_2_kmax);}}
Activity
ytmimi commentedon Sep 13, 2026
Can you do a better job explaining what the issue is?
Xyndra commentedon Sep 13, 2026
The issue is that it is not indenting the function calls like it normally would.
Usually, it indents like this:
But in the example I provided, they are all in the column where the base calls/assignments/definitions usually are
ytmimi commentedon Sep 14, 2026
There's something about wrapping
2_i32.pow(kmax.try_into().expect("k_max could not convert into u32"))in parens that's causing the issue. The following formats just fine:Input
Output
[-]Ugly formatting[/-][+]Nested call chains have weird formatting[/+]