Closed yshwanth closed 1 year ago
few nits to address:
rust doesnt require you to use ; when returning . If you dont use ; it implies return, and also doesnt need the return key word.
you only need to use the return keyword if you want to return from inside an inner scope, for example from inside a match statement.
if check < error_margin {
return true;
} else {
return false;
}
can just be
if check < error_margin {
true
} else {
false
}
there are some parts of the example where you have added ; to some returns, these are also unecessary
also noticed you have made some formatting changes, so we might as well unify it across the project.
let check = (solution - submission).abs();
check < error_margin
This is valid too, running cargo clippy
let check = (solution - submission).abs();
check < error_margin
This is valid too, running cargo clippy
you can go one step better and avoid creating a variable check - will be more memory optimized
Good one!
Thanks!
Updated the example code of actix server