Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Dec 19, 2024
1 parent 9a3abd7 commit ef0dfd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn handle_request(req: Request) -> Response {
// application it could be XML, protobuf, or anything else.
let result = {
// The GSV library is used to parse the CSV.
use rows <- result.try(gsv.to_lists(body))
use rows <- result.try(gsv.to_lists(body) |> result.replace_error(Nil))

// Get the first row, which is the header row.
use headers <- result.try(list.first(rows))
Expand Down
2 changes: 1 addition & 1 deletion examples/04-working-with-other-formats/test/app_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ pub fn post_successful_test() {

response
|> testing.string_body
|> should.equal("headers,row-count\n\"name,is-cool\",2")
|> should.equal("headers,row-count\n\"name,is-cool\",2\n")
}

0 comments on commit ef0dfd6

Please sign in to comment.