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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ToValue as the bound for captured values #1

Merged
merged 1 commit into from Sep 1, 2019

Conversation

@KodrAus
Copy link
Contributor

commented Sep 1, 2019

Hi! 馃憢

This PR allows any T: ToValue to be used as the value in a captured key-value pair instead of just strings. See: rust-lang-nursery/log#353 where we should also make this change.

Description

Instead of expecting a &[(&str, &str)], we can take a &[(&str, &dyn ToValue)], which still implements the Source trait. That way values like integers can also be captured, along with more complex values if they use an adapter.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
@KodrAus KodrAus referenced this pull request Sep 1, 2019
0 of 1 task complete
Copy link
Owner

left a comment

Ohhhhhh, this is fantastic. Thanks so much for sharing!!

@yoshuawuyts yoshuawuyts merged commit 4d1cd07 into yoshuawuyts:master Sep 1, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.