diff --git a/crates/matrix-sdk-common/src/linked_chunk/mod.rs b/crates/matrix-sdk-common/src/linked_chunk/mod.rs index 4c7d60713..9df230ee5 100644 --- a/crates/matrix-sdk-common/src/linked_chunk/mod.rs +++ b/crates/matrix-sdk-common/src/linked_chunk/mod.rs @@ -134,6 +134,12 @@ impl LinkedChunkId<'_> { } } +impl<'a> From<&'a OwnedLinkedChunkId> for LinkedChunkId<'a> { + fn from(value: &'a OwnedLinkedChunkId) -> Self { + value.as_ref() + } +} + impl PartialEq<&OwnedLinkedChunkId> for LinkedChunkId<'_> { fn eq(&self, other: &&OwnedLinkedChunkId) -> bool { match (self, other) { @@ -189,6 +195,12 @@ impl OwnedLinkedChunkId { } } +impl From> for OwnedLinkedChunkId { + fn from(value: LinkedChunkId<'_>) -> Self { + value.to_owned() + } +} + /// Errors of [`LinkedChunk`]. #[derive(thiserror::Error, Debug)] pub enum Error {