From f2975b82c20cb953b09460f0a98d9549edab19cb Mon Sep 17 00:00:00 2001 From: rock Date: Mon, 7 Sep 2026 13:37:57 -0700 Subject: [PATCH] fix: sqlx offline cache + borrow fix + Dockerfile + unified CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add .sqlx/ query cache (generated from live DB) - SQLX_OFFLINE=true in Dockerfile (no DB at build time) - Fix borrow checker errors in versioning.rs (ref from) - rust:1.81 → rust:1-bookworm - cargo build --release -p mem-cli - Single CI job, DOCKER_HOST, build+push on all events --- .gitea/workflows/build.yaml | 19 +++---- ...cfe4fafb0c1bd435353b205f582bfda8873bc.json | 52 ++++++++++++++++++ ...fbd51c602bdc1b437988f54e6c7fe268b9816.json | 52 ++++++++++++++++++ ...d033dcc4cb41f6c851bf447a9238810684d18.json | 53 +++++++++++++++++++ ...62f4e48f104ea77732aa1d32ecb797f70e71d.json | 53 +++++++++++++++++++ ...c758637c902dda2cc10366662988c6973ca48.json | 53 +++++++++++++++++++ Dockerfile | 7 +-- ...cfe4fafb0c1bd435353b205f582bfda8873bc.json | 52 ++++++++++++++++++ ...fbd51c602bdc1b437988f54e6c7fe268b9816.json | 52 ++++++++++++++++++ ...d033dcc4cb41f6c851bf447a9238810684d18.json | 53 +++++++++++++++++++ ...62f4e48f104ea77732aa1d32ecb797f70e71d.json | 53 +++++++++++++++++++ ...c758637c902dda2cc10366662988c6973ca48.json | 53 +++++++++++++++++++ crates/mem-store/src/versioning.rs | 36 ++++++------- 13 files changed, 555 insertions(+), 33 deletions(-) create mode 100644 .sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json create mode 100644 .sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json create mode 100644 .sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json create mode 100644 .sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json create mode 100644 .sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json create mode 100644 crates/mem-store/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json create mode 100644 crates/mem-store/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json create mode 100644 crates/mem-store/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json create mode 100644 crates/mem-store/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json create mode 100644 crates/mem-store/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 3d45825..e8c2a09 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -32,12 +32,17 @@ jobs: run: cargo check -p mem-ingest 2>&1 | tail -20 || true - name: Get short SHA - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' id: sha run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build Docker image + run: | + docker build --no-cache --progress=plain \ + -t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \ + -t "${IMAGE}:latest" \ + -f Dockerfile . + - name: Registry login - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' run: | echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" \ --username "${REGISTRY_USER}" --password-stdin @@ -45,21 +50,11 @@ jobs: REGISTRY_USER: ${{ secrets.FORGEJO_REGISTRY_USER }} REGISTRY_TOKEN: ${{ secrets.FORGEJO_REGISTRY_TOKEN }} - - name: Build Docker image - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - run: | - docker build --no-cache \ - -t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \ - -t "${IMAGE}:latest" \ - -f Dockerfile . - - name: Push Docker image - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' run: | docker push "${IMAGE}:${{ steps.sha.outputs.short_sha }}" docker push "${IMAGE}:latest" echo "✓ Pushed: ${IMAGE}:${{ steps.sha.outputs.short_sha }}" - name: Prune unused images - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' run: docker image prune -a --force 2>&1 | tail -3 || true diff --git a/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json b/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json new file mode 100644 index 0000000..8cbf0c7 --- /dev/null +++ b/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_entity_version\n WHERE entity_id = $1\n ORDER BY version_num DESC\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc" +} diff --git a/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json b/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json new file mode 100644 index 0000000..6a40d9c --- /dev/null +++ b/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_edge_version\n WHERE edge_id = $1\n ORDER BY version_num DESC\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816" +} diff --git a/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json b/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json new file mode 100644 index 0000000..61e13f9 --- /dev/null +++ b/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_entity_version\n WHERE entity_id = $1 AND changed_at <= $2\n ORDER BY version_num DESC\n LIMIT 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18" +} diff --git a/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json b/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json new file mode 100644 index 0000000..9fe298e --- /dev/null +++ b/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_entity_version\n WHERE entity_id = $1 AND version_num = $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text", + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d" +} diff --git a/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json b/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json new file mode 100644 index 0000000..c4cca32 --- /dev/null +++ b/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_edge_version\n WHERE edge_id = $1 AND version_num = $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48" +} diff --git a/Dockerfile b/Dockerfile index eb5ec97..5643798 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ # Multi-stage build for Poimen Memory Service (Rust) # Stage 1: Builder -FROM rust:1.81-bookworm as builder +FROM rust:1-bookworm as builder WORKDIR /build # Copy source COPY . . -# Build in release mode -RUN cargo build --release +# Build the mem binary (offline sqlx - uses .sqlx/ cache) +ENV SQLX_OFFLINE=true +RUN cargo build --release -p mem-cli # Stage 2: Runtime FROM debian:bookworm-slim diff --git a/crates/mem-store/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json b/crates/mem-store/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json new file mode 100644 index 0000000..8cbf0c7 --- /dev/null +++ b/crates/mem-store/.sqlx/query-1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_entity_version\n WHERE entity_id = $1\n ORDER BY version_num DESC\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "1e81bb729531ca33e4cef21623bcfe4fafb0c1bd435353b205f582bfda8873bc" +} diff --git a/crates/mem-store/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json b/crates/mem-store/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json new file mode 100644 index 0000000..6a40d9c --- /dev/null +++ b/crates/mem-store/.sqlx/query-62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_edge_version\n WHERE edge_id = $1\n ORDER BY version_num DESC\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "62d65d4afc4d292b37de8e5cb59fbd51c602bdc1b437988f54e6c7fe268b9816" +} diff --git a/crates/mem-store/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json b/crates/mem-store/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json new file mode 100644 index 0000000..61e13f9 --- /dev/null +++ b/crates/mem-store/.sqlx/query-aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_entity_version\n WHERE entity_id = $1 AND changed_at <= $2\n ORDER BY version_num DESC\n LIMIT 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "aee5900f5e3d7cbba23729bbf2dd033dcc4cb41f6c851bf447a9238810684d18" +} diff --git a/crates/mem-store/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json b/crates/mem-store/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json new file mode 100644 index 0000000..9fe298e --- /dev/null +++ b/crates/mem-store/.sqlx/query-c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_entity_version\n WHERE entity_id = $1 AND version_num = $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text", + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "c045466e1fe037dbdafea1008f262f4e48f104ea77732aa1d32ecb797f70e71d" +} diff --git a/crates/mem-store/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json b/crates/mem-store/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json new file mode 100644 index 0000000..c4cca32 --- /dev/null +++ b/crates/mem-store/.sqlx/query-ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n version_num,\n operation,\n snapshot,\n changed_at,\n changed_by,\n COALESCE(fields_changed, '{}') as \"fields_changed!\"\n FROM memory_edge_version\n WHERE edge_id = $1 AND version_num = $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version_num", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "operation", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "snapshot", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "changed_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "changed_by", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "fields_changed!", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + null + ] + }, + "hash": "ca6872495bc04c6a65531279af8c758637c902dda2cc10366662988c6973ca48" +} diff --git a/crates/mem-store/src/versioning.rs b/crates/mem-store/src/versioning.rs index e463240..0c6c723 100644 --- a/crates/mem-store/src/versioning.rs +++ b/crates/mem-store/src/versioning.rs @@ -111,28 +111,28 @@ impl EntityVersioningService { let mut modified = Vec::new(); // Check removed and modified - if let Some(from) = from_obj { + if let Some(ref from) = from_obj { for (key, from_val) in from { if let Some(to) = &to_obj { - if let Some(to_val) = to.get(&key) { - if from_val != *to_val { + if let Some(to_val) = to.get(key) { + if from_val != to_val { modified.push(DiffField { - name: key, - from_value: Some(from_val), + name: key.clone(), + from_value: Some(from_val.clone()), to_value: Some(to_val.clone()), }); } } else { removed.push(DiffField { - name: key, - from_value: Some(from_val), + name: key.clone(), + from_value: Some(from_val.clone()), to_value: None, }); } } else { removed.push(DiffField { - name: key, - from_value: Some(from_val), + name: key.clone(), + from_value: Some(from_val.clone()), to_value: None, }); } @@ -301,28 +301,28 @@ fn compute_diff( let mut removed = Vec::new(); let mut modified = Vec::new(); - if let Some(from) = from_obj { + if let Some(ref from) = from_obj { for (key, from_val) in from { if let Some(to) = &to_obj { - if let Some(to_val) = to.get(&key) { - if from_val != *to_val { + if let Some(to_val) = to.get(key) { + if from_val != to_val { modified.push(DiffField { - name: key, - from_value: Some(from_val), + name: key.clone(), + from_value: Some(from_val.clone()), to_value: Some(to_val.clone()), }); } } else { removed.push(DiffField { - name: key, - from_value: Some(from_val), + name: key.clone(), + from_value: Some(from_val.clone()), to_value: None, }); } } else { removed.push(DiffField { - name: key, - from_value: Some(from_val), + name: key.clone(), + from_value: Some(from_val.clone()), to_value: None, }); }