Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing adapter traits using macro #396

Merged
merged 1 commit into from
Apr 8, 2019
Merged

Conversation

adamAndMath
Copy link
Contributor

I'm submitting a refactor of trait implementations for adapter traits

Description

As all the trait implementations are the same across all adapters, they can be implemented using a single macro.

Motivation

Reducing code duplication and improving transparency of intent.

Tests

As there are no code changes, this change is covered by existing tests

@todo
Copy link

todo bot commented Apr 8, 2019

Self doesn't work rust-lang/rust#52808

// TODO: Self doesn't work https://github.com/rust-lang/rust/issues/52808
f.write_str(self.encode_lower(&mut [0; super::$T::LENGTH]))
}
}
impl<$($a),*> fmt::UpperHex for super::$T<$($a),*> {


This comment was generated by todo based on a TODO comment in 7da2597 in #396. cc @adamAndMath.

@todo
Copy link

todo bot commented Apr 8, 2019

Self doesn't work rust-lang/rust#52808

// TODO: Self doesn't work https://github.com/rust-lang/rust/issues/52808
f.write_str(self.encode_upper(&mut [0; super::$T::LENGTH]))
}
}
impl_adapter_from!($T<$($a),*>);


This comment was generated by todo based on a TODO comment in 7da2597 in #396. cc @adamAndMath.

@Dylan-DPC-zz
Copy link
Member

bors: r+

bors bot added a commit that referenced this pull request Apr 8, 2019
396: Implementing adapter traits using macro r=Dylan-DPC a=adamAndMath

I'm submitting a refactor of trait implementations for adapter traits


# Description
As all the trait implementations are the same across all adapters, they can be implemented using a single macro.

# Motivation
Reducing code duplication and improving transparency of intent.

# Tests
As there are no code changes, this change is covered by existing tests

Co-authored-by: Adam <[email protected]>
@bors bors bot merged commit 7da2597 into uuid-rs:master Apr 8, 2019
@bors
Copy link
Contributor

bors bot commented Apr 8, 2019

@kinggoesgaming
Copy link
Member

Had this in mind for a LONGGG time thanks

bors bot added a commit that referenced this pull request Oct 17, 2019
433: Prepare for 0.8.0 release r=Dylan-DPC a=KodrAus

Closes #431 

[Changeset since the last release](0.7.4...master)

Includes:

- #427 
- #419 
- #424 
- #418 
- #413 
- #407 
- #404 
- #400 
- #399 
- #398 
- #397 
- #396 
- #394 
- #393 
- #390
- #389 
- #388 

I've also added some docs to the 128bit integer methods to clarify how they're different than `to_fields` (for consistency with other uuid libs in the wild).

Co-authored-by: Ashley Mannix <[email protected]>
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.

3 participants