diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..f2769fa --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,32 @@ +name: pr + +on: + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + # Install Rust with clippy/rustfmt + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + target: wasm32-unknown-unknown + components: clippy, rustfmt + + # Set RUSTFLAGS + - run: echo "RUSTFLAGS=--cfg=web_sys_unstable_apis" >> $GITHUB_ENV + + # Make sure u guys don't write bad code + - run: cargo check + - run: cargo clippy --no-deps + - run: cargo fmt --check + + # Check for unused dependencies + - uses: bnjbvr/cargo-machete@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..34d50d1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: release + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Instal Rust + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + # Run release-plz to create PRs and releases + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/src/audio/decoder.rs b/src/audio/decoder.rs index e69de29..8b13789 100644 --- a/src/audio/decoder.rs +++ b/src/audio/decoder.rs @@ -0,0 +1 @@ + diff --git a/src/audio/encoder.rs b/src/audio/encoder.rs index e69de29..8b13789 100644 --- a/src/audio/encoder.rs +++ b/src/audio/encoder.rs @@ -0,0 +1 @@ + diff --git a/src/video/color.rs b/src/video/color.rs index 1ea258b..ab910f4 100644 --- a/src/video/color.rs +++ b/src/video/color.rs @@ -2,6 +2,12 @@ pub struct VideoColorSpaceConfig { inner: web_sys::VideoColorSpaceInit, } +impl Default for VideoColorSpaceConfig { + fn default() -> Self { + Self::new() + } +} + impl VideoColorSpaceConfig { pub fn new() -> Self { Self { @@ -15,17 +21,17 @@ impl VideoColorSpaceConfig { } pub fn matrix(self, matrix: VideoMatrixCoefficients) -> Self { - self.inner.set_matrix(matrix.into()); + self.inner.set_matrix(matrix); self } pub fn primaries(self, primaries: VideoColorPrimaries) -> Self { - self.inner.set_primaries(primaries.into()); + self.inner.set_primaries(primaries); self } pub fn transfer(self, transfer: VideoTransferCharacteristics) -> Self { - self.inner.set_transfer(transfer.into()); + self.inner.set_transfer(transfer); self } }