@@ -368,7 +368,7 @@ pub struct BindgenContext {
368
368
translation_unit : clang:: TranslationUnit ,
369
369
370
370
/// Target information that can be useful for some stuff.
371
- target_info : Option < clang:: TargetInfo > ,
371
+ target_info : clang:: TargetInfo ,
372
372
373
373
/// The options given by the user via cli or other medium.
374
374
options : BindgenOptions ,
@@ -584,10 +584,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
584
584
585
585
/// Returns `true` if the target architecture is wasm32
586
586
pub fn is_target_wasm32 ( & self ) -> bool {
587
- match self . target_info {
588
- Some ( ref ti) => ti. triple . starts_with ( "wasm32-" ) ,
589
- None => false ,
590
- }
587
+ self . target_info . triple . starts_with ( "wasm32-" )
591
588
}
592
589
593
590
/// Creates a timer for the current bindgen phase. If time_phases is `true`,
@@ -600,10 +597,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
600
597
/// Returns the pointer width to use for the target for the current
601
598
/// translation.
602
599
pub fn target_pointer_size ( & self ) -> usize {
603
- if let Some ( ref ti) = self . target_info {
604
- return ti. pointer_width / 8 ;
605
- }
606
- mem:: size_of :: < * mut ( ) > ( )
600
+ return self . target_info . pointer_width / 8 ;
607
601
}
608
602
609
603
/// Get the stack of partially parsed types that we are in the middle of
0 commit comments