---
title: "Comment by Wilfred Almeida on \"🦀 Rust Series 02: CLI Game\" | Hashnode"
description: "I tried putting the menu in a loop. read_line() appends to the String choice so the newly given input won&#39;t be processed. To deal with this, call the choice"
url: "https://hashnode.com/posts/rust-series-02-cli-game/63e3418f4f69afd2796cf66f/comment/63e52e73db59c3f72b9f2ad4"
---

[Discussion](https://hashnode.com/posts/rust-series-02-cli-game/63e3418f4f69afd2796cf66f)

Comment [🦀 Rust Series 02: CLI Game](https://hashnode.com/posts/rust-series-02-cli-game/63e3418f4f69afd2796cf66f)

[Wilfred Almeida](https://hashnode.com/@WilfredAlmeida)

[Feb 9, 2023](https://hashnode.com/posts/rust-series-02-cli-game/63e3418f4f69afd2796cf66f/comment/63e52e73db59c3f72b9f2ad4)

I tried putting the menu in a loop.

read\_line() appends to the String choice so the newly given input won't be processed.

To deal with this, call the choice.clear() before calling read\_line() in the loop.

[Anam Ansari](https://hashnode.com/@anamansari062)

[Feb 11, 2023](https://hashnode.com/posts/rust-series-02-cli-game/63e3418f4f69afd2796cf66f/comment/63e52e73db59c3f72b9f2ad4#reply-63e759f0c23c310c9a85f795)

Correct!
