Skip to content

Comments

fix: make build.rs example compile by adding anyhow imports and Resul…#1674

Open
meelon-dev wants to merge 1 commit into0xMiden:nextfrom
meelon-dev:mainfnct
Open

fix: make build.rs example compile by adding anyhow imports and Resul…#1674
meelon-dev wants to merge 1 commit into0xMiden:nextfrom
meelon-dev:mainfnct

Conversation

@meelon-dev
Copy link

Summary

The build.rs example in proto/README.md was not compiling:

  • ? was used in main() without main() returning a Result.
  • .context(...) was used, but anyhow::Context was not imported.

Changes

  • Added use anyhow::{Context, Result}; to imports.
  • Changed fn main() to fn main() -> Result<()>.
  • Added Ok(()) at the end of main() to satisfy the Result return type.

Reason

This makes the example compile correctly and demonstrates modern, idiomatic Rust error handling using anyhow.

Notes

  • Only README/example code is affected.
  • Works with users’ projects using anyhow and ? for concise error propagation.

@bobbinth bobbinth requested review from Mirko-von-Leipzig, TomasArrachea and sergerad and removed request for TomasArrachea February 14, 2026 19:02
@sergerad
Copy link
Collaborator

@Mirko-von-Leipzig does this readme need to spell out a build.rs contents at all?

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.

2 participants