Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

editor: Implement `From` instead of `Into` for converting `BlockId`s to `ElementId`s (#14839)

Marshall Bowersa5b8094082ec
diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rs
index 630b96d50ca..5302bfa73b6 100644
--- a/crates/editor/src/display_map/block_map.rs
+++ b/crates/editor/src/display_map/block_map.rs
@@ -136,12 +136,12 @@ impl From<BlockId> for EntityId {
}
}
-impl Into<ElementId> for BlockId {
- fn into(self) -> ElementId {
- match self {
- Self::Custom(CustomBlockId(id)) => ("Block", id).into(),
- Self::ExcerptHeader(id) => ("ExcerptHeader", EntityId::from(id)).into(),
- Self::ExcerptFooter(id) => ("ExcerptFooter", EntityId::from(id)).into(),
+impl From<BlockId> for ElementId {
+ fn from(value: BlockId) -> Self {
+ match value {
+ BlockId::Custom(CustomBlockId(id)) => ("Block", id).into(),
+ BlockId::ExcerptHeader(id) => ("ExcerptHeader", EntityId::from(id)).into(),
+ BlockId::ExcerptFooter(id) => ("ExcerptFooter", EntityId::from(id)).into(),
}
}
}