Skip to content

Conversation

@jmecom
Copy link
Owner

@jmecom jmecom commented Dec 31, 2025

No description provided.

Jordan Mecom and others added 4 commits December 30, 2025 17:33
- Fix match expression syntax in http_server.cap (use explicit returns
  inside match arms instead of return match)
- Add TcpConn::read(max_size) method that reads available bytes without
  waiting for EOF, which is required for HTTP since clients keep
  connections open
- Update HTTP server to use read(4096) instead of read_to_string()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Flatten nested matches by inlining expressions
- Use single-line match arms for simple cases
- Extract handle_request helper to reduce nesting in serve_once
- Remove redundant intermediate variables
- Use early returns to avoid else branches
- Simplify response functions to single return statements

Reduces code from 183 to 133 lines while maintaining functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This method discards the error type, allowing Results with different
error types to be unified. Useful for propagating errors with ?.

Note: Currently has a codegen limitation - cannot be used directly
with ? operator due to "unsupported match result value" error.
The method works correctly in other contexts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jmecom jmecom merged commit 66bd384 into main Dec 31, 2025
1 check passed
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