MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / shift_point

Function shift_point

tests/binary/mutable_borrow/src/main.rs:21–25  ·  view source on GitHub ↗

Function taking a mutable borrow of the whole Point

(p: &mut Point)

Source from the content-addressed store, hash-verified

19}
20
21// Function taking a shared borrow of a Point and reading
22fn get_x_coord(p: &Point) -> i32 {
23 p.x // Just read the x field
24}
25
26// Function taking a mutable borrow of the whole Point
27fn shift_point(p: &mut Point) {
28 p.x += 10; // Modify field directly via mutable borrow of struct

Callers 1

mainFunction · 0.85

Calls 1

make_y_negativeFunction · 0.85

Tested by

no test coverage detected