Skip to content

Commit

Permalink
Merge pull request #813 from vks/fix-dyn-warn
Browse files Browse the repository at this point in the history
Fix deprecation warnings about dyn keyword
  • Loading branch information
dhardy committed Jun 3, 2019
2 parents 22155f1 + 7dd8317 commit d8a1254
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rand_jitter/README.md
Expand Up @@ -56,7 +56,7 @@ fn get_nstime() -> u64 {
dur.as_secs() << 30 | dur.subsec_nanos() as u64
}
fn main() -> Result<(), Box<Error>> {
fn main() -> Result<(), Box<dyn Error>> {
let mut rng = JitterRng::new_with_timer(get_nstime);
// 1_000_000 results are required for the
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/other.rs
Expand Up @@ -182,7 +182,7 @@ mod tests {

#[test]
fn test_misc() {
let rng: &mut RngCore = &mut ::test::rng(820);
let rng: &mut dyn RngCore = &mut ::test::rng(820);

rng.sample::<char, _>(Standard);
rng.sample::<bool, _>(Standard);
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/weighted/mod.rs
Expand Up @@ -225,7 +225,7 @@ impl ::std::error::Error for WeightedError {
fn description(&self) -> &str {
self.msg()
}
fn cause(&self) -> Option<&::std::error::Error> {
fn cause(&self) -> Option<&dyn (::std::error::Error)> {
None
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Expand Up @@ -649,7 +649,7 @@ mod test {
fn test_rng_trait_object() {
use distributions::{Distribution, Standard};
let mut rng = rng(109);
let mut r = &mut rng as &mut RngCore;
let mut r = &mut rng as &mut dyn RngCore;
r.next_u32();
r.gen::<i32>();
assert_eq!(r.gen_range(0, 1), 0);
Expand All @@ -661,7 +661,7 @@ mod test {
fn test_rng_boxed_trait() {
use distributions::{Distribution, Standard};
let rng = rng(110);
let mut r = Box::new(rng) as Box<RngCore>;
let mut r = Box::new(rng) as Box<dyn RngCore>;
r.next_u32();
r.gen::<i32>();
assert_eq!(r.gen_range(0, 1), 0);
Expand Down

0 comments on commit d8a1254

Please sign in to comment.