"threads" not being used

The first warning states that the "threads" field is not being used. It looks used to me. am I wrong ?

You assign to it but you never use it.

Isn’t it being used on lines 10 and 17 ?

The unused warning is on the field of ThreadPool at line 3, the threads local variable at line 10 is a totally different thing.
And at line 17 you assign the local variable threads to the struct field but you never access it, that’s why the compiler give you a warning.

I guess the tutorial from the rust book hasn’t gotten to that step yet. probably will use it in main.rs

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.