1
1
use std:: time;
2
2
3
+ #[ cfg( feature = "legacy" ) ]
4
+ use sass_embedded_host_rust:: legacy:: LegacyOptionsBuilder ;
3
5
use sass_embedded_host_rust:: { Options , Sass } ;
4
6
5
7
fn exe_path ( ) -> std:: path:: PathBuf {
@@ -19,7 +21,6 @@ fn main() {
19
21
let bootstrap_grid = path. join ( "bootstrap-grid.scss" ) ;
20
22
let bootstrap_reboot = path. join ( "bootstrap-reboot.scss" ) ;
21
23
let bootstrap_utilities = path. join ( "bootstrap-utilities.scss" ) ;
22
- let now = time:: Instant :: now ( ) ;
23
24
let mut sass = Sass :: new ( exe_path ( ) ) ;
24
25
let _ = sass
25
26
. compile ( bootstrap. to_string_lossy ( ) , Options :: default ( ) )
@@ -33,5 +34,53 @@ fn main() {
33
34
let _ = sass
34
35
. compile ( bootstrap_utilities. to_string_lossy ( ) , Options :: default ( ) )
35
36
. unwrap ( ) ;
36
- dbg ! ( now. elapsed( ) ) ;
37
+
38
+ let now = time:: Instant :: now ( ) ;
39
+ let _ = sass
40
+ . compile ( bootstrap. to_string_lossy ( ) , Options :: default ( ) )
41
+ . unwrap ( ) ;
42
+ let _ = sass
43
+ . compile ( bootstrap_grid. to_string_lossy ( ) , Options :: default ( ) )
44
+ . unwrap ( ) ;
45
+ let _ = sass
46
+ . compile ( bootstrap_reboot. to_string_lossy ( ) , Options :: default ( ) )
47
+ . unwrap ( ) ;
48
+ let _ = sass
49
+ . compile ( bootstrap_utilities. to_string_lossy ( ) , Options :: default ( ) )
50
+ . unwrap ( ) ;
51
+ println ! ( "modern: {:?}" , now. elapsed( ) ) ;
52
+
53
+ #[ cfg( feature = "legacy" ) ]
54
+ {
55
+ let now = time:: Instant :: now ( ) ;
56
+ let _ = sass
57
+ . render (
58
+ LegacyOptionsBuilder :: default ( )
59
+ . file ( bootstrap. to_string_lossy ( ) )
60
+ . build ( ) ,
61
+ )
62
+ . unwrap ( ) ;
63
+ let _ = sass
64
+ . render (
65
+ LegacyOptionsBuilder :: default ( )
66
+ . file ( bootstrap_grid. to_string_lossy ( ) )
67
+ . build ( ) ,
68
+ )
69
+ . unwrap ( ) ;
70
+ let _ = sass
71
+ . render (
72
+ LegacyOptionsBuilder :: default ( )
73
+ . file ( bootstrap_reboot. to_string_lossy ( ) )
74
+ . build ( ) ,
75
+ )
76
+ . unwrap ( ) ;
77
+ let _ = sass
78
+ . render (
79
+ LegacyOptionsBuilder :: default ( )
80
+ . file ( bootstrap_utilities. to_string_lossy ( ) )
81
+ . build ( ) ,
82
+ )
83
+ . unwrap ( ) ;
84
+ println ! ( "legacy: {:?}" , now. elapsed( ) ) ;
85
+ }
37
86
}
0 commit comments