#Rusty help por favor

10 messages · Page 1 of 1 (latest)

midnight grove
#

what exactly is the error happening? i and intInput should both be i32

night gust
#

It says that input in the while loop is considered a string

#

setting input to something like 3 makes it work

midnight grove
#

ok so what is the exact error message

night gust
#

error[E0277]: can't compare {integer} with String
--> src\main.rs:15:13
|
15 | while i < input {
| ^ no implementation for {integer} < String and {integer} > String
|
= help: the trait PartialOrd<String> is not implemented for {integer}
= help: the following other types implement trait PartialOrd<Rhs>:

midnight grove
#

so uhh, it seems like your conversion of string to integer is commented out

night gust
#

Noooo they don't work

#

Same outcome with intInput

#

But now it works 😅

midnight grove
#

That’s because the loop is comparing against input not the converted intInput