c2rust-refactor 0.15.0

C2Rust refactoring tool implementation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
refactor:transform(
    function(transform)
        transform:replace_expr("$x:Expr.wrapping_add($y:Expr)", "$x + $y")
        transform:replace_expr("$x:Expr.wrapping_sub($y:Expr)", "$x - $y")
        transform:replace_expr("$x:Expr.wrapping_mul($y:Expr)", "$x * $y")
        transform:replace_expr("$x:Expr.wrapping_div($y:Expr)", "$x / $y")
        transform:replace_expr("$x:Expr.wrapping_rem($y:Expr)", "$x % $y")
        transform:replace_expr("$x:Expr.wrapping_neg()", "-$x")
        transform:replace_expr("$x:Expr.wrapping_shl($y:Expr)", "$x << $y")
        transform:replace_expr("$x:Expr.wrapping_shr($y:Expr)", "$x >> $y")
        transform:replace_expr("$x:Expr.wrapping_abs()", "$x.abs()")
    end
)
refactor:save_crate()