diff --git a/bench/string-accumulate.carp b/bench/string-accumulate.carp index bd55431..218b191 100644 --- a/bench/string-accumulate.carp +++ b/bench/string-accumulate.carp @@ -1,5 +1,5 @@ (load "Bench.carp") -(load "git@github.com:carpentry-org/strbuf@0.2.1") +(load "git@github.com:carpentry-org/strbuf@0.3.0") ; Build an array of n string chunks of the given size. (defn make-chunks [n size] diff --git a/http-client.carp b/http-client.carp index ac87d0c..f5d28ea 100644 --- a/http-client.carp +++ b/http-client.carp @@ -1,7 +1,7 @@ (load "git@github.com:carpentry-org/socket@0.2.5") -(load "git@github.com:carpentry-org/http@0.5.0") +(load "git@github.com:carpentry-org/http@0.6.0") (load "git@github.com:carpentry-org/tls@0.2.1") -(load "git@github.com:carpentry-org/strbuf@0.2.1") +(load "git@github.com:carpentry-org/strbuf@0.3.0") ; Byte-indexed prefix/suffix tests; the core ones measure in bytes but slice ; in characters. @@ -520,8 +520,7 @@ that cares about a truncated body must check `error` afterwards.") (when (String.contains-string? &acc "\r\n\r\n") (set! found true))))) (Result.Error _) (set! found true))) - (let-do [acc (StringBuf.to-string &sb)] - (StringBuf.delete sb) + (let [acc (StringBuf.into-string sb)] (let [split-pos (String.index-of-string &acc "\r\n\r\n")] (if (< split-pos 0) (Result.Error (ClientError.Receive @"incomplete HTTP headers")) @@ -804,8 +803,7 @@ headers first, then either drain the body or hand the stream on. (match (ResponseStream.poll s) (Maybe.Nothing) (set! done true) (Maybe.Just chunk) (StringBuf.append-str &sb &chunk))) - (let-do [body (StringBuf.to-string &sb)] - (StringBuf.delete sb) + (let [body (StringBuf.into-string sb)] (match @(ResponseStream.error s) (Maybe.Just e) (Result.Error e) (Maybe.Nothing) (Result.Success body))))) diff --git a/src/cookie-jar.carp b/src/cookie-jar.carp index 5e2096a..07f2199 100644 --- a/src/cookie-jar.carp +++ b/src/cookie-jar.carp @@ -198,9 +198,7 @@ if no cookies match. Cookies are serialized longest path first.") (when (> i 0) (StringBuf.append-str &sb "; ")) (StringBuf.append-str &sb &(Cookie.kv (Array.unsafe-nth &matched i))))) - (let-do [s (StringBuf.to-string &sb)] - (StringBuf.delete sb) - (Maybe.Just s)))))) + (Maybe.Just (StringBuf.into-string sb)))))) (doc apply-to-headers "adds a Cookie header for matching cookies to the headers map. Returns headers unchanged if no cookies match.") diff --git a/src/multipart.carp b/src/multipart.carp index 5c2900e..bb73167 100644 --- a/src/multipart.carp +++ b/src/multipart.carp @@ -205,4 +205,4 @@ without those characters are emitted unchanged.") (StringBuf.append-str &sb boundary) (StringBuf.append-str &sb "--") (StringBuf.append-crlf &sb) - (let-do [result (StringBuf.to-string &sb)] (StringBuf.delete sb) result)))) + (StringBuf.into-string sb))))