I am working my way through the codefights exercises and ended up with some messy code for what, in Python, is relatively simple string slicing and concatenation:

```py
s = "the quick (brown (fox) jumps) over"
(f, t) = (18, 21)
ss = s[:f] + s[t-1:f-1:-1] + s[t:]

```

In Rust:

```
let s = String::from("the quick (brown (fox) jumps) over");
let sc: Vec<_> = s.chars().collect();
let (f, t) = (18, 21); // result of searching through sc
let mut new_s: Vec<_> = sc[..f].into_iter().collect();
new_s.extend(&sc[f..t].into_iter().rev().collect::<Vec<_>>());
new_s.extend(&sc[t..].into_iter().collect::<Vec<_>>());
let mut ss = String::with_capacity(new_s.len());
for c in new_s.iter() {ss.push(**c);}

```

Mainly by adding things to fix compile errors I've ended up with complexity that I just don't seem able to reduce. What is the 'proper' way to do this in Rust?

I didn't do something like the answer using `replace()` because this is a simplified example of a problem to search through a string and reverse the parts inside matching brackets.