I don't like that I match Some(_) and than replacing the value, also the expected returning type is string so when there is no such item it returns "" but this looks clutter to me
I don't like that when you insert the index is not used. It seems a very weird behavior. Is expect that is I called your function with index 99, my string would afterwards appear at index 99.
I agree, but it's a problem with the API. It's combining two operations that don't combine well. Either the user is aware when the index is out of bounds and could more easily not use this function, or the user is not sure if the index is in bounds and therefore might be surprised by the result. I don't see how this function can be both useful and correct.