-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from kyle-mccarthy/fix/derive-macro
feat: use fully qualified syntax when calling `fake_with_rng` in derive macro
- Loading branch information
Showing
9 changed files
with
80 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
use crate::{Dummy, Fake, Faker}; | ||
use rand::Rng; | ||
|
||
use random_color::{RandomColor, Luminosity}; | ||
use random_color::{Luminosity, RandomColor}; | ||
|
||
impl Dummy<Faker> for RandomColor { | ||
fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self { | ||
RandomColor { | ||
hue: None, | ||
luminosity: Some(Luminosity::Random), | ||
seed: Some((u64::MIN..u64::MAX).fake_with_rng::<u64, _>(rng)), | ||
alpha: Some((0..10).fake_with_rng::<i8, _>(rng) as f32 / 10.) | ||
alpha: Some((0..10).fake_with_rng::<i8, _>(rng) as f32 / 10.), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters