@@ -245,9 +245,9 @@ mod block {
245245 }
246246 }
247247
248- impl Into < BlockType > for BlockTypePy {
249- fn into ( self ) -> BlockType {
250- BlockType :: try_from ( self as u8 ) . expect ( "Enums are out of sync!" )
248+ impl From < BlockTypePy > for BlockType {
249+ fn from ( val : BlockTypePy ) -> Self {
250+ BlockType :: try_from ( val as u8 ) . expect ( "Enums are out of sync!" )
251251 }
252252 }
253253
@@ -272,7 +272,7 @@ mod block {
272272 }
273273 None => Err ( InvalidAccessorError :: new_err ( format ! (
274274 "The block at {} doesn't exist." ,
275- self . block_coord. to_string ( )
275+ self . block_coord
276276 ) ) ) ,
277277 }
278278 }
@@ -308,7 +308,7 @@ mod chunk {
308308 ) ) ,
309309 None => Err ( InvalidAccessorError :: new_err ( format ! (
310310 "The chunk at {} doesn't exist." ,
311- self . coord. to_string ( )
311+ self . coord
312312 ) ) ) ,
313313 }
314314 }
@@ -346,7 +346,6 @@ mod chunk {
346346 world_db
347347 . chunks
348348 . keys ( )
349- . into_iter ( )
350349 . map ( |value| ChunkCoordPy { inner : value } ) ,
351350 )
352351 }
@@ -834,9 +833,9 @@ pub mod item {
834833 }
835834 }
836835
837- impl Into < ItemType > for ItemTypePy {
838- fn into ( self ) -> ItemType {
839- ItemType :: try_from ( self as u16 ) . expect ( "Enums are out of sync!" )
836+ impl From < ItemTypePy > for ItemType {
837+ fn from ( val : ItemTypePy ) -> Self {
838+ ItemType :: try_from ( val as u16 ) . expect ( "Enums are out of sync!" )
840839 }
841840 }
842841
@@ -859,9 +858,9 @@ pub mod item {
859858 }
860859 }
861860
862- impl Into < ChestType > for ChestTypePy {
863- fn into ( self ) -> ChestType {
864- ChestType :: try_from ( self as u8 ) . expect ( "Enums are out of sync!" )
861+ impl From < ChestTypePy > for ChestType {
862+ fn from ( val : ChestTypePy ) -> Self {
863+ ChestType :: from ( val as u8 )
865864 }
866865 }
867866
@@ -909,9 +908,9 @@ pub mod item {
909908 }
910909 }
911910
912- impl Into < WorkbenchType > for WorkbenchTypePy {
913- fn into ( self ) -> WorkbenchType {
914- WorkbenchType :: try_from ( self as u8 ) . expect ( "Enums are out of sync!" )
911+ impl From < WorkbenchTypePy > for WorkbenchType {
912+ fn from ( val : WorkbenchTypePy ) -> Self {
913+ WorkbenchType :: from ( val as u8 )
915914 }
916915 }
917916
@@ -936,9 +935,9 @@ pub mod item {
936935 }
937936 }
938937
939- impl Into < PigmentColor > for PigmentColorPy {
940- fn into ( self ) -> PigmentColor {
941- PigmentColor :: try_from ( self as u8 ) . expect ( "Enums are out of sync!" )
938+ impl From < PigmentColorPy > for PigmentColor {
939+ fn from ( val : PigmentColorPy ) -> Self {
940+ PigmentColor :: try_from ( val as u8 ) . expect ( "Enums are out of sync!" )
942941 }
943942 }
944943
0 commit comments