Skip to content

Commit

Permalink
fix credo warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
satoren committed Jan 21, 2025
1 parent b34fb3c commit 4db883b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ jobs:
matrix:
rust:
- stable
env:
RUSTLER_PRECOMPILATION_MEDIASOUP_BUILD: "true"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Elixir
Expand Down Expand Up @@ -104,8 +106,6 @@ jobs:
_build
key: ${{ runner.os }}-rust-${{ matrix.rust }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-rust-${{ matrix.rust }}-mix-
- name: Install precompiled nif
run: mix rustler_precompiled.download Mediasoup.Nif --only-local
- name: Run dialyzer
run: mix dialyzer
- name: generate docs
Expand Down
5 changes: 3 additions & 2 deletions lib/nif.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ defmodule Mediasoup.Nif do
version = Mix.Project.config()[:version]

defmodule Build do
@moduledoc false
def prebuild_targets() do
# Anything that is difficult to prebuilt in cross compile is excluded for now.
[
Expand All @@ -22,7 +23,7 @@ defmodule Mediasoup.Nif do
]
end

defp is_prebuild_target?() do
defp prebuild_target?() do
case RustlerPrecompiled.target() do
{:ok, target} -> prebuild_targets() |> Enum.any?(&String.contains?(target, &1))
_ -> false
Expand All @@ -32,7 +33,7 @@ defmodule Mediasoup.Nif do
def force_build?(),
do:
System.get_env("RUSTLER_PRECOMPILATION_MEDIASOUP_BUILD") in ["1", "true"] or
not is_prebuild_target?()
not prebuild_target?()
end

use RustlerPrecompiled,
Expand Down
3 changes: 3 additions & 0 deletions test/integration/test_util.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule Mediasoup.TestUtil do
@moduledoc """
Test utilities
"""
import ExUnit.Assertions

def worker_leak_setup_all(_context \\ %{}) do
Expand Down

0 comments on commit 4db883b

Please sign in to comment.