Skip to content

feat: add allow_unused_value bindgen override for fluent APIs#356

Merged
ivov merged 1 commit into
mainfrom
bindgen-allow-unused-value
May 8, 2026
Merged

feat: add allow_unused_value bindgen override for fluent APIs#356
ivov merged 1 commit into
mainfrom
bindgen-allow-unused-value

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented May 8, 2026

Adds an allow_unused_value bindgen override and applies it to the web routing API in beego so route registrations no longer require let _ =.

import "go:github.com/beego/beego/v2/server/web"
import ctx "go:github.com/beego/beego/v2/server/web/context"

fn main() {
  web.Get("/", |c: Ref<ctx.Context>| {
    c.WriteString("Hello, world!")
  })
  web.Run(":8080")
}

Before this change, every web.Get and sibling registration (Post, Put, Delete, Router, InsertFilter, ...) returned Ref<HttpServer> for fluent chaining, so each call tripped lint.unused_value and forced a let _ = prefix.

@ivov ivov merged commit 1f18bcf into main May 8, 2026
12 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Released in lisette-v0.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant