Others have already pointed out the issue - in Rust, String is UTF-8 encoded and therefore characters are variable length. So you can't just change a character in a string, as it may not fit (e.g. replacing 'a' with '🙂' would lead to trouble).
You can do what the others suggest, but honestly for a game like hangman, I'd suggest you just work directly with chars and don't use any string. As in, just use a Vec instead of a string. Then you can freely change characters based on index, but this representation uses more memory than a typical String. But this won't matter for your use case.