@@ -169,7 +169,7 @@ impl ImportGraphDefOptions {
169169 unsafe {
170170 tf:: TF_ImportGraphDefOptionsSetUniquifyNames (
171171 self . inner ,
172- if uniquify_names { 1 } else { 0 } ,
172+ u8 :: from ( uniquify_names) ,
173173 ) ;
174174 }
175175 }
@@ -181,7 +181,7 @@ impl ImportGraphDefOptions {
181181 unsafe {
182182 tf:: TF_ImportGraphDefOptionsSetUniquifyPrefix (
183183 self . inner ,
184- if uniquify_prefix { 1 } else { 0 } ,
184+ u8 :: from ( uniquify_prefix) ,
185185 ) ;
186186 }
187187 }
@@ -693,7 +693,7 @@ impl Graph {
693693 tf:: TF_GraphToFunction (
694694 self . inner ( ) ,
695695 fn_name_cstr. as_ptr ( ) ,
696- if append_hash_to_fn_name { 1 } else { 0 } ,
696+ u8 :: from ( append_hash_to_fn_name) ,
697697 num_opers,
698698 c_opers_ptr,
699699 c_inputs. len ( ) as c_int ,
@@ -2033,7 +2033,7 @@ impl<'a> OperationDescription<'a> {
20332033 ) -> std:: result:: Result < ( ) , NulError > {
20342034 let c_attr_name = CString :: new ( attr_name) ?;
20352035 unsafe {
2036- tf:: TF_SetAttrBool ( self . inner , c_attr_name. as_ptr ( ) , if value { 1 } else { 0 } ) ;
2036+ tf:: TF_SetAttrBool ( self . inner , c_attr_name. as_ptr ( ) , u8 :: from ( value) ) ;
20372037 }
20382038 Ok ( ( ) )
20392039 }
@@ -2045,7 +2045,7 @@ impl<'a> OperationDescription<'a> {
20452045 value : & [ bool ] ,
20462046 ) -> std:: result:: Result < ( ) , NulError > {
20472047 let c_attr_name = CString :: new ( attr_name) ?;
2048- let c_value: Vec < c_uchar > = value. iter ( ) . map ( |x| if * x { 1 } else { 0 } ) . collect ( ) ;
2048+ let c_value: Vec < c_uchar > = value. iter ( ) . map ( |x| u8 :: from ( * x ) ) . collect ( ) ;
20492049 unsafe {
20502050 tf:: TF_SetAttrBoolList (
20512051 self . inner ,
0 commit comments