-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unchecked integer range #224
Comments
Maybe duplicate of this #93. |
Yes, this is actually a limitation. The problem is here that the format (toml in this case, but others apply here as well) does not define the datatype (besides "Number"). By specifying We cannot do much here, on the library side of things, actually (or I'm wrong and someone comes up with something clever...). We need you to know about your data, so you have to make sure that you ask for a |
Thanks for answer! let port: u16 = conf
.get_int("server.port")
.unwrap()
.try_into() // here
.unwrap(); or this: let port = conf
.get_string("server.port")
.unwrap()
.parse::<u16>()
.unwrap(); |
Okay, I'm closing this therefore, feel free to ping me if you have more questions on the matter! 😄 |
Greetings!
config
lib is casting all integers like explicit type conversion throughas
. Such behaviour by design, or this is an error?The text was updated successfully, but these errors were encountered: