From 96500c55cc900bc9854dccc014b4d51e805fdf44 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:33:34 +0000 Subject: [PATCH 1/4] switch to kesak/turtle --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ae6997e..f7d8520 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,7 +45,7 @@ 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 - name: Test From 1876583b9872244bc34a567355a28bddd4d0a668 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:37:16 +0000 Subject: [PATCH 2/4] 1.83 clippy --- src/compose/comment_strip_iter.rs | 4 ++-- src/compose/mod.rs | 2 +- src/compose/preprocess.rs | 26 +++++++++++++------------- src/compose/tokenizer.rs | 2 +- src/derive.rs | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/compose/comment_strip_iter.rs b/src/compose/comment_strip_iter.rs index fdf3cdc..21c04e5 100644 --- a/src/compose/comment_strip_iter.rs +++ b/src/compose/comment_strip_iter.rs @@ -106,11 +106,11 @@ impl<'a> Iterator for CommentReplaceIter<'a> { pub trait CommentReplaceExt<'a> { /// replace WGSL and GLSL comments with whitespace characters - fn replace_comments(&'a mut self) -> CommentReplaceIter; + fn replace_comments(&'a mut self) -> CommentReplaceIter<'a>; } impl<'a> CommentReplaceExt<'a> for Lines<'a> { - fn replace_comments(&'a mut self) -> CommentReplaceIter { + fn replace_comments(&'a mut self) -> CommentReplaceIter<'a> { CommentReplaceIter { lines: self, state: CommentState::None, diff --git a/src/compose/mod.rs b/src/compose/mod.rs index af6672f..dff0156 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, From f50445e8eea9834c6217f3949a83029d1fb5de83 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:03:03 +0000 Subject: [PATCH 3/4] maybe use 22.04 --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f7d8520..1023283 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,7 +38,7 @@ jobs: test-ubuntu: name: Test Suite (Ubuntu) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable From 61bbfd5ba9c1a9fc1e1d081f86c746681c381cb8 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:17:35 +0000 Subject: [PATCH 4/4] remove egl1-mesa --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1023283..fa75d2e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,7 +38,7 @@ jobs: test-ubuntu: name: Test Suite (Ubuntu) - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -47,7 +47,7 @@ jobs: sudo apt-get update -y -qq 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