File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ fn main() {
2727 ] ;
2828
2929 // Add debug define if in debug build
30- if build_profile == "debug" && ! ( target_env = = "msvc" ) {
30+ if build_profile == "debug" && ( target_env ! = "msvc" ) {
3131 common_cxx_defines. push ( ( "SLANG_DEBUG" , "1" ) ) ;
3232 common_cxx_defines. push ( ( "SLANG_ASSERT_ENABLED" , "1" ) ) ;
3333 } ;
Original file line number Diff line number Diff line change @@ -203,6 +203,12 @@ impl SyntaxTrees {
203203 }
204204}
205205
206+ impl Default for SyntaxTrees {
207+ fn default ( ) -> Self {
208+ Self :: new ( )
209+ }
210+ }
211+
206212impl SlangContext {
207213 /// Creates a new Slang session.
208214 pub fn new ( ) -> Self {
@@ -248,7 +254,8 @@ impl SlangContext {
248254 }
249255}
250256
251- /// Creates a new Slang session
252- pub fn new_session ( ) -> SlangContext {
253- SlangContext :: new ( )
257+ impl Default for SlangContext {
258+ fn default ( ) -> Self {
259+ Self :: new ( )
260+ }
254261}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use crate::sess::{Session, SessionIo};
1919use crate :: src:: { SourceFile , SourceGroup , SourceType } ;
2020use crate :: target:: TargetSet ;
2121
22- use bender_slang:: SlangPrintOpts ;
22+ use bender_slang:: { SlangContext , SlangPrintOpts , SyntaxTrees } ;
2323
2424/// Pickle files
2525#[ derive( Args , Debug ) ]
@@ -179,8 +179,8 @@ pub fn run(sess: &Session, args: PickleArgs) -> Result<()> {
179179 write ! ( writer, "[" ) ?;
180180 }
181181
182- let mut parsed_trees = bender_slang :: SyntaxTrees :: new ( ) ;
183- let mut slang = bender_slang :: new_session ( ) ;
182+ let mut parsed_trees = SyntaxTrees :: new ( ) ;
183+ let mut slang = SlangContext :: new ( ) ;
184184 for src_group in srcs {
185185 // Collect include directories and defines from the source group and command line arguments.
186186 let include_dirs: Vec < String > = src_group
You can’t perform that action at this time.
0 commit comments