@@ -190,8 +190,18 @@ const WHOLE_RANGE: &[CharRange] = &[
190
190
( '\x00' , :: std:: char:: MAX )
191
191
] ;
192
192
193
- /// The `CharStrategy` which picks from literally any character, with
194
- /// the default biases.
193
+ /// Creates a `CharStrategy` which picks from literally any character, with the
194
+ /// default biases.
195
+ pub fn any ( ) -> CharStrategy < ' static > {
196
+ CharStrategy {
197
+ special : Cow :: Borrowed ( DEFAULT_SPECIAL_CHARS ) ,
198
+ preferred : Cow :: Borrowed ( DEFAULT_PREFERRED_RANGES ) ,
199
+ ranges : Cow :: Borrowed ( WHOLE_RANGE ) ,
200
+ }
201
+ }
202
+
203
+ #[ allow( missing_docs) ]
204
+ #[ deprecated( since="0.4.0" , note="replaced with proptest::char::any()" ) ]
195
205
pub const ANY : CharStrategy < ' static > = CharStrategy {
196
206
special : Cow :: Borrowed ( DEFAULT_SPECIAL_CHARS ) ,
197
207
preferred : Cow :: Borrowed ( DEFAULT_PREFERRED_RANGES ) ,
@@ -336,7 +346,7 @@ mod test {
336
346
let mut runner = TestRunner :: default ( ) ;
337
347
338
348
for _ in 0 ..1024 {
339
- let ch = ANY . new_value ( & mut runner) . unwrap ( ) . current ( ) ;
349
+ let ch = any ( ) . new_value ( & mut runner) . unwrap ( ) . current ( ) ;
340
350
if '🕴' == ch {
341
351
men_in_business_suits_levitating += 1 ;
342
352
} else if ch >= ' ' && ch <= '~' {
@@ -354,7 +364,7 @@ mod test {
354
364
let mut runner = TestRunner :: default ( ) ;
355
365
356
366
for _ in 0 ..256 {
357
- let mut value = ANY . new_value ( & mut runner) . unwrap ( ) ;
367
+ let mut value = any ( ) . new_value ( & mut runner) . unwrap ( ) ;
358
368
359
369
if value. current ( ) <= ' ' { continue ; }
360
370
@@ -369,7 +379,7 @@ mod test {
369
379
370
380
#[ test]
371
381
fn test_sanity ( ) {
372
- check_strategy_sanity ( ANY , Some ( CheckStrategySanityOptions {
382
+ check_strategy_sanity ( any ( ) , Some ( CheckStrategySanityOptions {
373
383
// `simplify()` can itself `complicate()` back to the starting
374
384
// position, so the overly strict complicate-after-simplify check
375
385
// must be disabled.
0 commit comments