@@ -149,7 +149,7 @@ struct RelationshipStorageExecutor {
149149
150150fn json_value_to_bolt_value ( value : & serde_json:: Value ) -> Result < BoltType > {
151151 let bolt_value = match value {
152- serde_json:: Value :: Null => BoltType :: Null ( neo4rs:: BoltNull :: default ( ) ) ,
152+ serde_json:: Value :: Null => BoltType :: Null ( neo4rs:: BoltNull ) ,
153153 serde_json:: Value :: Bool ( v) => BoltType :: Boolean ( neo4rs:: BoltBoolean :: new ( * v) ) ,
154154 serde_json:: Value :: Number ( v) => {
155155 if let Some ( i) = v. as_i64 ( ) {
@@ -163,7 +163,7 @@ fn json_value_to_bolt_value(value: &serde_json::Value) -> Result<BoltType> {
163163 serde_json:: Value :: String ( v) => BoltType :: String ( neo4rs:: BoltString :: new ( v) ) ,
164164 serde_json:: Value :: Array ( v) => BoltType :: List ( neo4rs:: BoltList {
165165 value : v
166- . into_iter ( )
166+ . iter ( )
167167 . map ( json_value_to_bolt_value)
168168 . collect :: < Result < _ > > ( ) ?,
169169 } ) ,
@@ -220,7 +220,7 @@ fn basic_value_to_bolt(value: &BasicValue, schema: &BasicValueType) -> Result<Bo
220220 BasicValue :: Bytes ( v) => {
221221 BoltType :: Bytes ( neo4rs:: BoltBytes :: new ( bytes:: Bytes :: from_owner ( v. clone ( ) ) ) )
222222 }
223- BasicValue :: Str ( v) => BoltType :: String ( neo4rs:: BoltString :: new ( & v) ) ,
223+ BasicValue :: Str ( v) => BoltType :: String ( neo4rs:: BoltString :: new ( v) ) ,
224224 BasicValue :: Bool ( v) => BoltType :: Boolean ( neo4rs:: BoltBoolean :: new ( * v) ) ,
225225 BasicValue :: Int64 ( v) => BoltType :: Integer ( neo4rs:: BoltInteger :: new ( * v) ) ,
226226 BasicValue :: Float64 ( v) => BoltType :: Float ( neo4rs:: BoltFloat :: new ( * v) ) ,
@@ -242,7 +242,7 @@ fn basic_value_to_bolt(value: &BasicValue, schema: &BasicValueType) -> Result<Bo
242242 BasicValue :: Vector ( v) => match schema {
243243 BasicValueType :: Vector ( t) => BoltType :: List ( neo4rs:: BoltList {
244244 value : v
245- . into_iter ( )
245+ . iter ( )
246246 . map ( |v| basic_value_to_bolt ( v, & t. element_type ) )
247247 . collect :: < Result < _ > > ( ) ?,
248248 } ) ,
@@ -255,9 +255,9 @@ fn basic_value_to_bolt(value: &BasicValue, schema: &BasicValueType) -> Result<Bo
255255
256256fn value_to_bolt ( value : & Value , schema : & schema:: ValueType ) -> Result < BoltType > {
257257 let bolt_value = match value {
258- Value :: Null => BoltType :: Null ( neo4rs:: BoltNull :: default ( ) ) ,
258+ Value :: Null => BoltType :: Null ( neo4rs:: BoltNull ) ,
259259 Value :: Basic ( v) => match schema {
260- ValueType :: Basic ( t) => basic_value_to_bolt ( v, & t) ?,
260+ ValueType :: Basic ( t) => basic_value_to_bolt ( v, t) ?,
261261 _ => anyhow:: bail!( "Non-basic type got basic value: {}" , schema) ,
262262 } ,
263263 Value :: Struct ( v) => match schema {
@@ -267,7 +267,7 @@ fn value_to_bolt(value: &Value, schema: &schema::ValueType) -> Result<BoltType>
267267 Value :: Collection ( v) | Value :: List ( v) => match schema {
268268 ValueType :: Collection ( t) => BoltType :: List ( neo4rs:: BoltList {
269269 value : v
270- . into_iter ( )
270+ . iter ( )
271271 . map ( |v| field_values_to_bolt ( v. 0 . fields . iter ( ) , t. row . fields . iter ( ) ) )
272272 . collect :: < Result < _ > > ( ) ?,
273273 } ) ,
@@ -276,7 +276,7 @@ fn value_to_bolt(value: &Value, schema: &schema::ValueType) -> Result<BoltType>
276276 Value :: Table ( v) => match schema {
277277 ValueType :: Collection ( t) => BoltType :: List ( neo4rs:: BoltList {
278278 value : v
279- . into_iter ( )
279+ . iter ( )
280280 . map ( |( k, v) | {
281281 field_values_to_bolt (
282282 std:: iter:: once ( & Into :: < value:: Value > :: into ( k. clone ( ) ) )
@@ -681,8 +681,7 @@ impl RelationshipSetupState {
681681 } else if existing. nodes . iter ( ) . any ( |( label, existing_node) | {
682682 !self
683683 . nodes
684- . get ( label)
685- . map_or ( false , |node| node. is_compatible ( existing_node) )
684+ . get ( label) . is_some_and ( |node| node. is_compatible ( existing_node) )
686685 } ) {
687686 // If any node's key field change of some node label gone, we have to clear relationship.
688687 SetupStateCompatibility :: NotCompatible
@@ -747,7 +746,7 @@ impl SetupStatusCheck {
747746 . current
748747 . as_ref ( )
749748 . filter ( |existing_current| {
750- desired_state. as_ref ( ) . map_or ( true , |desired| {
749+ desired_state. as_ref ( ) . is_none_or ( |desired| {
751750 desired. check_compatible ( existing_current)
752751 == SetupStateCompatibility :: NotCompatible
753752 } )
@@ -793,7 +792,7 @@ impl SetupStatusCheck {
793792
794793 for ( index_name, vector_index) in desired_state. vector_indexes . into_iter ( ) {
795794 old_rel_indexes. shift_remove ( & index_name) ;
796- if !existing. current . as_ref ( ) . map_or ( false , |c| {
795+ if !existing. current . as_ref ( ) . is_some_and ( |c| {
797796 Some ( & vector_index) == c. vector_indexes . get ( & index_name)
798797 } ) {
799798 rel_index_to_create. insert ( index_name, vector_index) ;
@@ -807,8 +806,7 @@ impl SetupStatusCheck {
807806 . as_ref ( )
808807 . map ( |c| {
809808 c. nodes
810- . get ( & label)
811- . map_or ( false , |existing_node| node. is_compatible ( existing_node) )
809+ . get ( & label) . is_some_and ( |existing_node| node. is_compatible ( existing_node) )
812810 } )
813811 . unwrap_or ( false )
814812 {
@@ -820,8 +818,8 @@ impl SetupStatusCheck {
820818
821819 for ( index_name, vector_index) in node. vector_indexes . into_iter ( ) {
822820 old_node_indexes. shift_remove ( & index_name) ;
823- if !existing. current . as_ref ( ) . map_or ( false , |c| {
824- c. nodes . get ( & label) . map_or ( false , |n| {
821+ if !existing. current . as_ref ( ) . is_some_and ( |c| {
822+ c. nodes . get ( & label) . is_some_and ( |n| {
825823 Some ( & vector_index) == n. vector_indexes . get ( & index_name)
826824 } )
827825 } ) {
@@ -1189,8 +1187,8 @@ impl StorageFactoryBase for RelationshipFactory {
11891187 let mut tgt_label_analyzer = NodeLabelAnalyzer :: new ( & spec, & spec. target ) ?;
11901188 let mut rel_value_fields_info = vec ! [ ] ;
11911189 for ( field_idx, field_schema) in value_fields_schema. iter ( ) . enumerate ( ) {
1192- if !src_label_analyzer. process_field ( field_idx, & field_schema)
1193- && !tgt_label_analyzer. process_field ( field_idx, & field_schema)
1190+ if !src_label_analyzer. process_field ( field_idx, field_schema)
1191+ && !tgt_label_analyzer. process_field ( field_idx, field_schema)
11941192 {
11951193 rel_value_fields_info. push ( AnalyzedGraphFieldMapping {
11961194 field_idx,
0 commit comments