File tree 1 file changed +3
-0
lines changed
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,7 @@ pub trait Rng: RngCore {
521
521
/// # Example
522
522
///
523
523
/// ```rust
524
+ /// #[allow(deprecated)]
524
525
/// use rand::{thread_rng, Rng};
525
526
///
526
527
/// let mut rng = thread_rng();
@@ -532,6 +533,7 @@ pub trait Rng: RngCore {
532
533
/// // First meaningful use of `gen_weighted_bool`.
533
534
/// println!("{}", rng.gen_weighted_bool(3));
534
535
/// ```
536
+ #[ deprecated( since="0.5.0" , note="use gen_bool instead" ) ]
535
537
fn gen_weighted_bool ( & mut self , n : u32 ) -> bool {
536
538
// Short-circuit after `n <= 1` to avoid panic in `gen_range`
537
539
n <= 1 || self . gen_range ( 0 , n) == 0
@@ -1091,6 +1093,7 @@ mod test {
1091
1093
}
1092
1094
1093
1095
#[ test]
1096
+ #[ allow( deprecated) ]
1094
1097
fn test_gen_weighted_bool ( ) {
1095
1098
let mut r = rng ( 104 ) ;
1096
1099
assert_eq ! ( r. gen_weighted_bool( 0 ) , true ) ;
You can’t perform that action at this time.
0 commit comments