From 87213c574bd9503626cd9adfb47371fcd23e0b15 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:28:59 -0400 Subject: [PATCH] Update to moonc v0.1.20240902+a8d98d78a Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- README.md | 6 +++--- moon.mod.json | 2 +- pdk/http/header.mbt | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4219cfd..dce0469 100644 --- a/README.md +++ b/README.md @@ -527,9 +527,9 @@ The code has been updated to support compiler: ```bash $ moon version --all -moon 0.1.20240823 (f608aa3 2024-08-23) ~/.moon/bin/moon -moonc v0.1.20240823+c622a5ab0 ~/.moon/bin/moonc -moonrun 0.1.20240822 (efda7a5 2024-08-22) ~/.moon/bin/moonrun +moon 0.1.20240902 (a1bf66a 2024-09-02) ~/.moon/bin/moon +moonc v0.1.20240902+47bcb87c9 ~/.moon/bin/moonc +moonrun 0.1.20240902 (a1bf66a 2024-09-02) ~/.moon/bin/moonrun ``` Use `moonup` to manage `moon` compiler versions: diff --git a/moon.mod.json b/moon.mod.json index b16bd88..303d072 100644 --- a/moon.mod.json +++ b/moon.mod.json @@ -1,6 +1,6 @@ { "name": "extism/moonbit-pdk", - "version": "0.39.0", + "version": "0.40.0", "deps": {}, "readme": "README.md", "repository": "https://github.com/extism/moonbit-pdk", diff --git a/pdk/http/header.mbt b/pdk/http/header.mbt index 3c8adf6..bc10de3 100644 --- a/pdk/http/header.mbt +++ b/pdk/http/header.mbt @@ -10,15 +10,15 @@ pub fn Header::new() -> Header { /// `add` adds a value to a named (by `key`) header field. /// If the header key already exists, the value is appended after a comma. pub fn add(self : Header, key : String, value : String) -> Unit { - match self.0.get(key) { - Some(v) => self.0[key] = "\{v},\{value}" - None => self.0[key] = value + match self._.get(key) { + Some(v) => self._[key] = "\{v},\{value}" + None => self._[key] = value } } /// `set` overwrites a value to a named (by `key`) header field. pub fn set(self : Header, key : String, value : String) -> Unit { - self.0[key] = value + self._[key] = value } test "Header::add" { @@ -27,9 +27,9 @@ test "Header::add" { h.add("key2", "one") h.add("key2", "two") h.add("key2", "two") - assert_eq!(h.0.get("nokey"), None) - assert_eq!(h.0.get("key1"), Some("one")) - assert_eq!(h.0.get("key2"), Some("one,two,two")) + assert_eq!(h._.get("nokey"), None) + assert_eq!(h._.get("key1"), Some("one")) + assert_eq!(h._.get("key2"), Some("one,two,two")) } test "Header::to_json works as expected" {