mirror of
https://github.com/actix/examples
synced 2025-05-11 07:52:57 +02:00
style: remove extra blank lines in do_something_random function
This commit is contained in:
parent
3fbe782be8
commit
738c8879fd
@ -87,10 +87,8 @@ impl ResponseError for CustomError {
|
|||||||
/// randomly returns either () or one of the 4 CustomError variants
|
/// randomly returns either () or one of the 4 CustomError variants
|
||||||
async fn do_something_random() -> Result<(), CustomError> {
|
async fn do_something_random() -> Result<(), CustomError> {
|
||||||
let mut rng = rand::rng();
|
let mut rng = rand::rng();
|
||||||
|
|
||||||
// 20% chance of success
|
// 20% chance of success
|
||||||
const SUCCESS_PROBABILITY: f64 = 0.2;
|
const SUCCESS_PROBABILITY: f64 = 0.2;
|
||||||
|
|
||||||
if rng.random_bool(SUCCESS_PROBABILITY) {
|
if rng.random_bool(SUCCESS_PROBABILITY) {
|
||||||
log::info!("Random operation succeeded");
|
log::info!("Random operation succeeded");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user