From 305b7610ad600446919a15f68d4225fdf610ab37 Mon Sep 17 00:00:00 2001 From: "Jan Winkelmann (keks)" Date: Thu, 25 Jan 2024 09:20:01 +0100 Subject: [PATCH] address feedback --- openmls/src/extensions/mod.rs | 3 ++- openmls/src/group/mls_group/test_mls_group.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openmls/src/extensions/mod.rs b/openmls/src/extensions/mod.rs index 1263c148c9..292142001b 100644 --- a/openmls/src/extensions/mod.rs +++ b/openmls/src/extensions/mod.rs @@ -438,6 +438,7 @@ impl Extensions { }) } + /// Get a reference to the mutable [`Metadata`] if there is any. pub fn metadata(&self) -> Option<&Metadata> { self.find_by_type(ExtensionType::Metadata) .and_then(|e| match e { @@ -515,7 +516,7 @@ impl Extension { /// Get a reference to this extension as immutable [`Metadata`]. /// Returns an [`ExtensionError::InvalidExtensionType`] error if called on /// an [`Extension`] that's not an immutable [`Metadata`] extension. - pub fn as_protected_metadata_extension(&self) -> Result<&Metadata, ExtensionError> { + pub fn as_immutable_metadata_extension(&self) -> Result<&Metadata, ExtensionError> { match self { Self::ImmutableMetadata(e) => Ok(e), _ => Err(ExtensionError::InvalidExtensionType( diff --git a/openmls/src/group/mls_group/test_mls_group.rs b/openmls/src/group/mls_group/test_mls_group.rs index ffcff7cb01..23eb00c826 100644 --- a/openmls/src/group/mls_group/test_mls_group.rs +++ b/openmls/src/group/mls_group/test_mls_group.rs @@ -1017,7 +1017,7 @@ fn immutable_metadata(ciphersuite: Ciphersuite, provider: &impl OpenMlsProvider) Extensions::single(Extension::ImmutableMetadata(metadata.clone())); // === Create a Group with Metadata === - let var_name = Capabilities::new( + let capabilities = Capabilities::new( None, None, Some(&[ExtensionType::ImmutableMetadata]), @@ -1027,7 +1027,7 @@ fn immutable_metadata(ciphersuite: Ciphersuite, provider: &impl OpenMlsProvider) let mut group_with_metadata = MlsGroup::builder() .with_group_context_extensions(extensions_with_metadata.clone()) .expect("error when setting initial metadata group extension") - .with_capabilities(var_name) + .with_capabilities(capabilities) .build(provider, &alice_signer, alice_credential_with_key.clone()) .expect("error creating group using builder");