Skip to content

Prepare v1.0.0 release#36

Merged
lvkv merged 6 commits intomainfrom
lvkv/v1.0.0
Apr 8, 2026
Merged

Prepare v1.0.0 release#36
lvkv merged 6 commits intomainfrom
lvkv/v1.0.0

Conversation

@lvkv
Copy link
Copy Markdown
Member

@lvkv lvkv commented Apr 2, 2026

I think this library is in good enough shape to call a 1.0 release. Changes from v0.2.0, stolen from the GitHub release notes generator:

What's Changed

I haven't made the following changes, but am open to being convinced:

  • Removing async-trait
  • Moving to async closures instead of future-producing closures

CC @max-heller

@lvkv lvkv requested a review from Copilot April 2, 2026 20:45
@lvkv lvkv self-assigned this Apr 2, 2026
@lvkv lvkv changed the title Prepare v.1.0.0 release Prepare v1.0.0 release Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the srv-rs crate for a v1.0.0 release by updating the crate’s published version and aligning user-facing documentation with the new release.

Changes:

  • Bump crate version from 0.2.0 to 1.0.0 in Cargo.toml.
  • Update the README dependency snippet to reference srv-rs v1.0.0.
  • Update the authors metadata in Cargo.toml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
README.md Updates the Cargo.toml usage snippet to reference v1.0.0.
Cargo.toml Bumps package version to 1.0.0 and updates package metadata (authors).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Cargo.toml
@lvkv lvkv requested a review from dudebout April 2, 2026 21:07
@ping-deshaw2
Copy link
Copy Markdown

Minor review feedback:

  • Error::Lookup is lossy, it doesn't preserve the stack trace of the underlying error, since we are using thiserror, this can be fixed by marking it #[from].
  • sort_key should have documentation stating it is only an approximation of the running sum algorithm in RFC 2782.
  • A bunch of public things could be Debug (Affinity, AffinityUriIter, Rfc2782)
  • Accessing LibResolv can panic, there could be documentation for the panic when libresolv fails to initialize.
  • AffinityUriIter could have a remaining: usize, so it can implement ExactSizeIterator.

@lvkv lvkv mentioned this pull request Apr 6, 2026
@lvkv
Copy link
Copy Markdown
Member Author

lvkv commented Apr 6, 2026

@ping-deshaw2:

  • Error::Lookup is lossy, it doesn't preserve the stack trace of the underlying error, since we are using thiserror, this can be fixed by marking it #[from].
  • A bunch of public things could be Debug (Affinity, AffinityUriIter, Rfc2782)
  • Accessing LibResolv can panic, there could be documentation for the panic when libresolv fails to initialize.

Done.

  • AffinityUriIter could have a remaining: usize, so it can implement ExactSizeIterator.

I decided against implementing this: there's not much (if any) benefit to the end user IMO

  • sort_key should have documentation stating it is only an approximation of the running sum algorithm in RFC 2782.

This is the most interesting one. I wanted to make this RFC-compliant, but literally implementing the algorithm as specified in the RFC would've required a somewhat large refactor of the codebase. Instead, I heavily leaned on Claude to research an alternative implementation of sort_key that would preserve the same distribution. It now uses weighted random sampling (specifically algorithm A-Res). I've added a unit test for this to assert RFC-compliant behavior. There's wiggle room for interpretation, especially around how often records with weight 0 are selected in the presence of other records with non-zero weights within the same priority, but I'm quite satisfied with the result, especially when compared to the accuracy of the existing approximation. Definitely open to comments on this one.

@lvkv
Copy link
Copy Markdown
Member Author

lvkv commented Apr 6, 2026

but I'm quite satisfied with the result

Aside from it being potentially overkill, potentially slower. I'll benchmark this, actually...

@lvkv
Copy link
Copy Markdown
Member Author

lvkv commented Apr 7, 2026

I'll benchmark this, actually...

It came back over 3 times slower. Coupled with the decreased readability of that implementation, I decided to revert back to the original and add a comment about it being an approximation.

@lvkv lvkv force-pushed the lvkv/v1.0.0 branch 2 times, most recently from 986410c to 07ac8f2 Compare April 7, 2026 14:53
@lvkv lvkv merged commit ecf0a86 into main Apr 8, 2026
5 checks 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.

4 participants