Skip to content

Commit

Permalink
im just throwing shit at the wall to see what sticks tbh
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Apr 16, 2024
1 parent 42aa7ea commit 9fe6ec8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/rand/src/shared/pick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ where
let length = options.length::<usize>()?;
match length {
0 => return Ok(ByondValue::null()),
1 => return options.read_list_index(&1),
1 => return options.read_list_index(&1).map(ByondValue::persist),
_ => {}
}
let idx = rng.gen_range::<usize, _>(1..=length);
Expand All @@ -32,7 +32,7 @@ where
let length = options.length::<usize>()?;
match length {
0 => return Ok(ByondValue::null()),
1 => return options.read_list_index(&1),
1 => return options.read_list_index(&1).map(ByondValue::persist),
_ => {}
}
let options = options.read_assoc_list()?;
Expand All @@ -49,6 +49,7 @@ where
.get(1)
.and_then(|entry| entry.get(1))
.cloned()
.map(ByondValue::persist)
.unwrap_or_default())
}
_ => {}
Expand Down

0 comments on commit 9fe6ec8

Please sign in to comment.