@@ -174,7 +174,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
174
174
let rlang = slice:: from_raw_buf ( & ( * lang) . data ,
175
175
( * lang) . size as uint ) ;
176
176
let rlang = str:: from_utf8 ( rlang) . unwrap ( ) ;
177
- if LangString :: parse ( rlang) . notrust {
177
+ if ! LangString :: parse ( rlang) . rust {
178
178
( my_opaque. dfltblk ) ( ob, orig_text, lang,
179
179
opaque as * mut libc:: c_void ) ;
180
180
true
@@ -320,7 +320,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
320
320
let s = str:: from_utf8 ( lang) . unwrap ( ) ;
321
321
LangString :: parse ( s)
322
322
} ;
323
- if block_info. notrust { return }
323
+ if ! block_info. rust { return }
324
324
let text = slice:: from_raw_buf ( & ( * text) . data , ( * text) . size as uint ) ;
325
325
let opaque = opaque as * mut hoedown_html_renderer_state ;
326
326
let tests = & mut * ( ( * opaque) . opaque as * mut :: test:: Collector ) ;
@@ -373,7 +373,7 @@ struct LangString {
373
373
should_fail : bool ,
374
374
no_run : bool ,
375
375
ignore : bool ,
376
- notrust : bool ,
376
+ rust : bool ,
377
377
test_harness : bool ,
378
378
}
379
379
@@ -383,7 +383,7 @@ impl LangString {
383
383
should_fail : false ,
384
384
no_run : false ,
385
385
ignore : false ,
386
- notrust : false ,
386
+ rust : false ,
387
387
test_harness : false ,
388
388
}
389
389
}
@@ -403,14 +403,13 @@ impl LangString {
403
403
"should_fail" => { data. should_fail = true ; seen_rust_tags = true ; } ,
404
404
"no_run" => { data. no_run = true ; seen_rust_tags = true ; } ,
405
405
"ignore" => { data. ignore = true ; seen_rust_tags = true ; } ,
406
- "notrust" => { data. notrust = true ; seen_rust_tags = true ; } ,
407
- "rust" => { data. notrust = false ; seen_rust_tags = true ; } ,
406
+ "rust" => { data. rust = true ; seen_rust_tags = true ; } ,
408
407
"test_harness" => { data. test_harness = true ; seen_rust_tags = true ; }
409
408
_ => { seen_other_tags = true }
410
409
}
411
410
}
412
411
413
- data. notrust |= seen_other_tags && ! seen_rust_tags;
412
+ data. rust |= ! seen_other_tags || seen_rust_tags;
414
413
415
414
data
416
415
}
@@ -452,28 +451,27 @@ mod tests {
452
451
#[ test]
453
452
fn test_lang_string_parse ( ) {
454
453
fn t ( s : & str ,
455
- should_fail : bool , no_run : bool , ignore : bool , notrust : bool , test_harness : bool ) {
454
+ should_fail : bool , no_run : bool , ignore : bool , rust : bool , test_harness : bool ) {
456
455
assert_eq ! ( LangString :: parse( s) , LangString {
457
456
should_fail: should_fail,
458
457
no_run: no_run,
459
458
ignore: ignore,
460
- notrust : notrust ,
459
+ rust : rust ,
461
460
test_harness: test_harness,
462
461
} )
463
462
}
464
463
465
- t ( "" , false , false , false , false , false ) ;
466
- t ( "rust" , false , false , false , false , false ) ;
467
- t ( "sh" , false , false , false , true , false ) ;
468
- t ( "notrust" , false , false , false , true , false ) ;
469
- t ( "ignore" , false , false , true , false , false ) ;
470
- t ( "should_fail" , true , false , false , false , false ) ;
471
- t ( "no_run" , false , true , false , false , false ) ;
472
- t ( "test_harness" , false , false , false , false , true ) ;
473
- t ( "{.no_run .example}" , false , true , false , false , false ) ;
474
- t ( "{.sh .should_fail}" , true , false , false , false , false ) ;
475
- t ( "{.example .rust}" , false , false , false , false , false ) ;
476
- t ( "{.test_harness .rust}" , false , false , false , false , true ) ;
464
+ t ( "" , false , false , false , true , false ) ;
465
+ t ( "rust" , false , false , false , true , false ) ;
466
+ t ( "sh" , false , false , false , false , false ) ;
467
+ t ( "ignore" , false , false , true , true , false ) ;
468
+ t ( "should_fail" , true , false , false , true , false ) ;
469
+ t ( "no_run" , false , true , false , true , false ) ;
470
+ t ( "test_harness" , false , false , false , true , true ) ;
471
+ t ( "{.no_run .example}" , false , true , false , true , false ) ;
472
+ t ( "{.sh .should_fail}" , true , false , false , true , false ) ;
473
+ t ( "{.example .rust}" , false , false , false , true , false ) ;
474
+ t ( "{.test_harness .rust}" , false , false , false , true , true ) ;
477
475
}
478
476
479
477
#[ test]
0 commit comments