@@ -6,9 +6,6 @@ use std::mem;
66use std:: ops:: Deref ;
77use wit_parser:: * ;
88
9- // NB: keep in sync with `crates/wit-parser/src/ast/lex.rs`
10- const PRINT_F32_F64_DEFAULT : bool = true ;
11-
129/// A utility for printing WebAssembly interface definitions to a string.
1310pub struct WitPrinter < O : Output = OutputToString > {
1411 /// Visitor that holds the WIT document being printed.
@@ -20,8 +17,6 @@ pub struct WitPrinter<O: Output = OutputToString> {
2017
2118 // Whether to print doc comments.
2219 emit_docs : bool ,
23-
24- print_f32_f64 : bool ,
2520}
2621
2722impl Default for WitPrinter {
@@ -37,10 +32,6 @@ impl<O: Output> WitPrinter<O> {
3732 output,
3833 any_items : false ,
3934 emit_docs : true ,
40- print_f32_f64 : match std:: env:: var ( "WIT_REQUIRE_F32_F64" ) {
41- Ok ( s) => s == "1" ,
42- Err ( _) => PRINT_F32_F64_DEFAULT ,
43- } ,
4435 }
4536 }
4637
@@ -543,20 +534,8 @@ impl<O: Output> WitPrinter<O> {
543534 Type :: S16 => self . output . ty ( "s16" , TypeKind :: BuiltIn ) ,
544535 Type :: S32 => self . output . ty ( "s32" , TypeKind :: BuiltIn ) ,
545536 Type :: S64 => self . output . ty ( "s64" , TypeKind :: BuiltIn ) ,
546- Type :: F32 => {
547- if self . print_f32_f64 {
548- self . output . ty ( "f32" , TypeKind :: BuiltIn )
549- } else {
550- self . output . ty ( "f32" , TypeKind :: BuiltIn )
551- }
552- }
553- Type :: F64 => {
554- if self . print_f32_f64 {
555- self . output . ty ( "f64" , TypeKind :: BuiltIn )
556- } else {
557- self . output . ty ( "f64" , TypeKind :: BuiltIn )
558- }
559- }
537+ Type :: F32 => self . output . ty ( "f32" , TypeKind :: BuiltIn ) ,
538+ Type :: F64 => self . output . ty ( "f64" , TypeKind :: BuiltIn ) ,
560539 Type :: Char => self . output . ty ( "char" , TypeKind :: BuiltIn ) ,
561540 Type :: String => self . output . ty ( "string" , TypeKind :: BuiltIn ) ,
562541 Type :: ErrorContext => self . output . ty ( "error-context" , TypeKind :: BuiltIn ) ,
0 commit comments