We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b64cce3 commit 7b997d5Copy full SHA for 7b997d5
cedar-policy-generators/src/schema.rs
@@ -1069,7 +1069,9 @@ impl Schema {
1069
-> Result<Vec<ast::InternalName>> {
1070
// Pre-select the number of entity types (minimum 1), then randomly select that many indices
1071
let num = u
1072
- .int_in_range(1..=(entity_types.len() % Self::PER_ACTION_REQUEST_ENV_LIMIT))
+ .int_in_range(
1073
+ 1..=std::cmp::min(entity_types.len(), Self::PER_ACTION_REQUEST_ENV_LIMIT),
1074
+ )
1075
.unwrap();
1076
let mut indices: Vec<usize> = (0..entity_types.len()).collect();
1077
let mut selected_indices = Vec::with_capacity(num);
0 commit comments