@@ -3,7 +3,7 @@ use crate::{
33 derive:: CacheWeight ,
44 prelude:: { lazy_static, q, r, s, CacheWeight , QueryExecutionError } ,
55 runtime:: gas:: { Gas , GasSizeOf } ,
6- schema:: { EntityKey , EntityType } ,
6+ schema:: { input :: VID_FIELD , EntityKey , EntityType } ,
77 util:: intern:: { self , AtomPool } ,
88 util:: intern:: { Error as InternError , NullValue , Object } ,
99} ;
@@ -913,21 +913,21 @@ impl Entity {
913913 /// Return the VID of this entity and if its missing or of a type different than
914914 /// i64 it panics.
915915 pub fn vid ( & self ) -> i64 {
916- self . get ( "vid" )
916+ self . get ( VID_FIELD )
917917 . expect ( "the vid is set" )
918918 . as_int8 ( )
919919 . expect ( "the vid is set to a valid value" )
920920 }
921921
922922 /// Sets the VID of the entity. The previous one is returned.
923923 pub fn set_vid ( & mut self , value : i64 ) -> Result < Option < Value > , InternError > {
924- self . 0 . insert ( "vid" , value. into ( ) )
924+ self . 0 . insert ( VID_FIELD , value. into ( ) )
925925 }
926926
927927 /// Sets the VID if it's not already set. Should be used only for tests.
928928 #[ cfg( debug_assertions) ]
929929 pub fn set_vid_if_empty ( & mut self ) {
930- let vid = self . get ( "vid" ) ;
930+ let vid = self . get ( VID_FIELD ) ;
931931 if vid. is_none ( ) {
932932 let _ = self . set_vid ( 100 ) . expect ( "the vid should be set" ) ;
933933 }
0 commit comments