In listing 9.10 in section 9.3, To Panic! or Not To Panic! the text indicates that the Guess struct prevents any guess outside of the range from 1 to 100. I agree that this is the case if you use the new method, but there is nothing to prevent me from doing the following:
let g = Guess { value: 1000 };
println!("value is {}", g.value());
Is there something missing from the text around that listing?
Thank you. I reread the section, and there is a mention of code outside the module, but it is buried in a single sentence inside a paragraph that discusses value being private.
Thanks again.