@@ -333,7 +333,8 @@ fn build_v8(is_asan: bool) {
333
333
. join ( "base" )
334
334
. join ( "options.h" ) ;
335
335
336
- set_abseil_options_to_use_namespace ( & abseil_options_path) . expect ( "Failed to modify options.h" ) ;
336
+ set_abseil_options_to_use_namespace ( & abseil_options_path)
337
+ . expect ( "Failed to modify options.h" ) ;
337
338
338
339
let gn_out = run_gn_gen ( & gn_args) ;
339
340
assert ! ( gn_out. exists( ) ) ;
@@ -1089,29 +1090,31 @@ fn env_bool(key: &str) -> bool {
1089
1090
)
1090
1091
}
1091
1092
1092
- fn set_abseil_options_to_use_namespace ( options_path : & PathBuf ) -> io:: Result < ( ) > {
1093
+ fn set_abseil_options_to_use_namespace (
1094
+ options_path : & PathBuf ,
1095
+ ) -> io:: Result < ( ) > {
1093
1096
// Read the contents of options.h
1094
1097
let current_content = fs:: read_to_string ( & options_path) ?;
1095
-
1098
+
1096
1099
// Create the expected content
1097
1100
let new_content = current_content
1098
- . lines ( )
1099
- . map ( |line| {
1100
- if line. contains ( "#define ABSL_OPTION_USE_INLINE_NAMESPACE" ) {
1101
- "#define ABSL_OPTION_USE_INLINE_NAMESPACE 1" . to_string ( )
1102
- } else if line. contains ( "#define ABSL_OPTION_INLINE_NAMESPACE_NAME" ) {
1103
- "#define ABSL_OPTION_INLINE_NAMESPACE_NAME v8" . to_string ( )
1104
- } else {
1105
- line. to_string ( )
1106
- }
1107
- } )
1108
- . collect :: < Vec < String > > ( )
1109
- . join ( "\n " ) ;
1110
-
1101
+ . lines ( )
1102
+ . map ( |line| {
1103
+ if line. contains ( "#define ABSL_OPTION_USE_INLINE_NAMESPACE" ) {
1104
+ "#define ABSL_OPTION_USE_INLINE_NAMESPACE 1" . to_string ( )
1105
+ } else if line. contains ( "#define ABSL_OPTION_INLINE_NAMESPACE_NAME" ) {
1106
+ "#define ABSL_OPTION_INLINE_NAMESPACE_NAME v8" . to_string ( )
1107
+ } else {
1108
+ line. to_string ( )
1109
+ }
1110
+ } )
1111
+ . collect :: < Vec < String > > ( )
1112
+ . join ( "\n " ) ;
1113
+
1111
1114
// Only write if content actually changed
1112
1115
if current_content != new_content {
1113
- let mut file = fs:: File :: create ( & options_path) ?;
1114
- file. write_all ( new_content. as_bytes ( ) ) ?;
1116
+ let mut file = fs:: File :: create ( & options_path) ?;
1117
+ file. write_all ( new_content. as_bytes ( ) ) ?;
1115
1118
}
1116
1119
1117
1120
Ok ( ( ) )
0 commit comments