Skip to content

Commit

Permalink
Update to moonc v0.1.20240902+a8d98d78a
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
  • Loading branch information
gmlewis committed Sep 2, 2024
1 parent df2968b commit 87213c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion moon.mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
14 changes: 7 additions & 7 deletions pdk/http/header.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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" {
Expand Down

0 comments on commit 87213c5

Please sign in to comment.