Core Intermediate

07  Ownership

The heart of Rust. These functions take ownership when they shouldn't -- borrow instead, so the caller keeps its values.

Step 2 / 3

Fix excite to take &mut String and push '!' onto it in place.

Hints
  • &mut T to modify; the check calls excite(&mut s).
07_ownership.rs
Reset to starterCompiled in a sandbox; hidden checks must pass.
Reveal solution
fn excite(s: &mut String) {
    s.push('!');
}