diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ae6997e..fa75d2e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,9 +45,9 @@ jobs: - name: install dependencies run: | sudo apt-get update -y -qq - sudo add-apt-repository ppa:kisak/kisak-mesa -y + sudo add-apt-repository ppa:kisak/turtle -y sudo apt-get update - sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers + sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers - name: Test run: xvfb-run cargo test diff --git a/src/compose/mod.rs b/src/compose/mod.rs index 4e0333f..1299ae3 100644 --- a/src/compose/mod.rs +++ b/src/compose/mod.rs @@ -458,7 +458,7 @@ impl Composer { auto: &'a mut u32, } - impl<'a> regex::Replacer for AutoBindingReplacer<'a> { + impl regex::Replacer for AutoBindingReplacer<'_> { fn replace_append(&mut self, _: ®ex::Captures<'_>, dst: &mut String) { dst.push_str(&format!("@binding({})", self.auto)); *self.auto += 1; diff --git a/src/compose/preprocess.rs b/src/compose/preprocess.rs index f9e0a04..280bd67 100644 --- a/src/compose/preprocess.rs +++ b/src/compose/preprocess.rs @@ -1036,9 +1036,9 @@ defined let PreprocessorMetaData { defines: shader_defs, .. - } = processor.get_preprocessor_metadata(&WGSL, true).unwrap(); + } = processor.get_preprocessor_metadata(WGSL, true).unwrap(); println!("defines: {:?}", shader_defs); - let result = processor.preprocess(&WGSL, &shader_defs).unwrap(); + let result = processor.preprocess(WGSL, &shader_defs).unwrap(); assert_eq!(result.preprocessed_source, EXPECTED); } @@ -1079,9 +1079,9 @@ bool: false let PreprocessorMetaData { defines: shader_defs, .. - } = processor.get_preprocessor_metadata(&WGSL, true).unwrap(); + } = processor.get_preprocessor_metadata(WGSL, true).unwrap(); println!("defines: {:?}", shader_defs); - let result = processor.preprocess(&WGSL, &shader_defs).unwrap(); + let result = processor.preprocess(WGSL, &shader_defs).unwrap(); assert_eq!(result.preprocessed_source, EXPECTED); } @@ -1113,7 +1113,7 @@ fn vertex( } "; let processor = Preprocessor::default(); - let result = processor.preprocess(&WGSL_ELSE_IFDEF, &[].into()).unwrap(); + let result = processor.preprocess(WGSL_ELSE_IFDEF, &[].into()).unwrap(); assert_eq!( result .preprocessed_source @@ -1190,7 +1190,7 @@ fn vertex( "; let processor = Preprocessor::default(); let result = processor - .preprocess(&WGSL_ELSE_IFDEF_NO_ELSE_FALLBACK, &[].into()) + .preprocess(WGSL_ELSE_IFDEF_NO_ELSE_FALLBACK, &[].into()) .unwrap(); assert_eq!( result @@ -1239,7 +1239,7 @@ fn vertex( let processor = Preprocessor::default(); let result = processor .preprocess( - &WGSL_ELSE_IFDEF, + WGSL_ELSE_IFDEF, &[("TEXTURE".to_string(), ShaderDefValue::Bool(true))].into(), ) .unwrap(); @@ -1287,7 +1287,7 @@ fn vertex( let processor = Preprocessor::default(); let result = processor .preprocess( - &WGSL_ELSE_IFDEF, + WGSL_ELSE_IFDEF, &[("SECOND_TEXTURE".to_string(), ShaderDefValue::Bool(true))].into(), ) .unwrap(); @@ -1335,7 +1335,7 @@ fn vertex( let processor = Preprocessor::default(); let result = processor .preprocess( - &WGSL_ELSE_IFDEF, + WGSL_ELSE_IFDEF, &[("THIRD_TEXTURE".to_string(), ShaderDefValue::Bool(true))].into(), ) .unwrap(); @@ -1383,7 +1383,7 @@ fn vertex( let processor = Preprocessor::default(); let result = processor .preprocess( - &WGSL_ELSE_IFDEF, + WGSL_ELSE_IFDEF, &[ ("SECOND_TEXTURE".to_string(), ShaderDefValue::Bool(true)), ("THIRD_TEXTURE".to_string(), ShaderDefValue::Bool(true)), @@ -1441,7 +1441,7 @@ fn vertex( let processor = Preprocessor::default(); let result = processor .preprocess( - &WGSL_COMPLICATED_ELSE_IFDEF, + WGSL_COMPLICATED_ELSE_IFDEF, &[("IS_DEFINED".to_string(), ShaderDefValue::Bool(true))].into(), ) .unwrap(); @@ -1475,7 +1475,7 @@ fail 3 const EXPECTED: &str = r"ok"; let processor = Preprocessor::default(); - let result = processor.preprocess(&INPUT, &[].into()).unwrap(); + let result = processor.preprocess(INPUT, &[].into()).unwrap(); assert_eq!( result .preprocessed_source @@ -1507,7 +1507,7 @@ fail 3 const EXPECTED: &str = r"ok"; let processor = Preprocessor::default(); let result = processor - .preprocess(&INPUT, &[("x".to_owned(), ShaderDefValue::Int(2))].into()) + .preprocess(INPUT, &[("x".to_owned(), ShaderDefValue::Int(2))].into()) .unwrap(); assert_eq!( result diff --git a/src/compose/tokenizer.rs b/src/compose/tokenizer.rs index b57577c..7bd9654 100644 --- a/src/compose/tokenizer.rs +++ b/src/compose/tokenizer.rs @@ -7,7 +7,7 @@ pub enum Token<'a> { Whitespace(&'a str, usize), } -impl<'a> Token<'a> { +impl Token<'_> { pub fn pos(&self) -> usize { match self { Token::Identifier(_, pos) | Token::Other(_, pos) | Token::Whitespace(_, pos) => *pos, diff --git a/src/derive.rs b/src/derive.rs index 8aeef3e..d79a1be 100644 --- a/src/derive.rs +++ b/src/derive.rs @@ -829,7 +829,7 @@ impl<'a> DerivedModule<'a> { } } -impl<'a> From> for naga::Module { +impl From> for naga::Module { fn from(derived: DerivedModule) -> Self { naga::Module { types: derived.types,