From d48ba909b4ab3b927b3ae7b99f52c4546b62ff3f Mon Sep 17 00:00:00 2001 From: Andrey Kononov Date: Sun, 20 Aug 2023 21:00:38 +0400 Subject: [PATCH] Fixed `delete` request --- CHANGELOG.md | 3 +++ examples/schema.rs | 8 ++------ src/codec/request/delete.rs | 2 +- src/codec/response/call.rs | 1 + src/lib.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 src/codec/response/call.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 352f297..ada8931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - `TupleResponse` type for decoding `eval` and `call` responses. +### Fixed + - `delete` request sends correct request type. + ## [0.0.5] - 2023-08-05 ### Added diff --git a/examples/schema.rs b/examples/schema.rs index 7d6b53c..42d2930 100644 --- a/examples/schema.rs +++ b/examples/schema.rs @@ -17,15 +17,11 @@ async fn main() -> Result<(), anyhow::Error> { .select::<(i64, String), _>(None, None, Some(IteratorType::All), ()) .await? ); - space.upsert(("=",), (1, "Second")).await?; + space.upsert((0, "Name"), ("=",)).await?; space .update( (0,), - (Value::Array(vec![ - "=".into(), - 1.into(), - "Second (updated)".into(), - ]),), + (Value::Array(vec!["=".into(), 1.into(), "Second".into()]),), ) .await?; info!( diff --git a/src/codec/request/delete.rs b/src/codec/request/delete.rs index 23dc9a7..44c31c5 100644 --- a/src/codec/request/delete.rs +++ b/src/codec/request/delete.rs @@ -33,7 +33,7 @@ impl Request for Delete { where Self: Sized, { - RequestType::Replace + RequestType::Delete } // NOTE: `&mut buf: mut` is required since I don't get why compiler complain diff --git a/src/codec/response/call.rs b/src/codec/response/call.rs new file mode 100644 index 0000000..124d990 --- /dev/null +++ b/src/codec/response/call.rs @@ -0,0 +1 @@ +pub struct CallResponse(rmpv::Value); diff --git a/src/lib.rs b/src/lib.rs index c1c2be9..a3ab4d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,7 @@ // // Other // -// * [ ] check or remove all unsafes, unwrap, panic, expect +// * [ ] check or remove all unsafes, panic // * [ ] tests // * [ ] bump version to 0.1.0 // * [ ] remove unused dependencies