fn verify_receiver_indices(
    receiver_keys: &BTreeMap<NodeIndex, FsEncryptionPublicKey>,
    number_of_receivers: NumberOfNodes,
) -> Result<(), MisnumberedReceiverError> {
    // Verify that the receivers are indexed correctly:
    for receiver_index in receiver_keys.keys().copied() {
        if receiver_index >= number_of_receivers.get() {
            let error = MisnumberedReceiverError {
                receiver_index,
                number_of_receivers,
            };
            return Err(error);
        }
    }
    Ok(())
}
/// Verifies that receivers are indexed correctly
///
/// # Errors
/// * `MisnumberedReceiverError` if the receiver indices are not
///   0..num_receivers-1 inclusive.
Verifies that receivers are indexed correctly
Verifies that receivers are indexed correctly
fn verify_receiver_indices(
    receiver_keys: &BTreeMap<NodeIndex, FsEncryptionPublicKey>,
    number_of_receivers: NumberOfNodes,
) -> Result<(), MisnumberedReceiverError> {
    // Verify that the receivers are indexed correctly:
    for receiver_index in receiver_keys.keys().copied() {
        if receiver_index >= number_of_receivers.get() {
            let error = MisnumberedReceiverError {
                receiver_index,
                number_of_receivers,
            };
            return Err(error);
        }
    }
    Ok(())
}
fn verify_receiver_indices ( receiver_keys : & BTreeMap < NodeIndex , FsEncryptionPublicKey > , number_of_receivers : NumberOfNodes , ) -> Result < ( ) , MisnumberedReceiverError > { // Verify that the receivers are indexed correctly: for receiver_index in receiver_keys . keys ( ) . copied ( ) { if receiver_index >= number_of_receivers . get ( ) { let error = MisnumberedReceiverError { receiver_index , number_of_receivers , } ; return Err ( error ) ; } } Ok ( ( ) ) }
Verifies that receivers are indexed correctly
Verifies that receivers are indexed correctly
receiver_keys
&BTreeMap<NodeIndex, FsEncryptionPublicKey>
number_of_receivers
NumberOfNodes
receiver_keys
&BTreeMap<NodeIndex, FsEncryptionPublicKey>
number_of_receivers
NumberOfNodes
errors
`MisnumberedReceiverError` if the receiver indices are not
0..num_receivers-1 inclusive.
` MisnumberedReceiverError ` if the receiver indices are not 0 .. num_receivers - 1 inclusive .