diff --git a/.cargo/config.toml b/.cargo/config.toml index 5dd2053..055c73b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,7 @@ -[build] +# build on linux +[build.'cfg(target_os = "linux")'] rustflags = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"] + +# build on macos +[build.'cfg(target_os = "macos")'] +rustflags = [] diff --git a/.github/workflows/cargo-clippy.yml b/.github/workflows/cargo-clippy.yml index 5a5aea4..03c9580 100644 --- a/.github/workflows/cargo-clippy.yml +++ b/.github/workflows/cargo-clippy.yml @@ -37,19 +37,5 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2.7.3 - - name: Check workflow permissions - id: check_permissions - uses: scherermichael-oss/action-has-permission@1.0.6 - with: - required-permission: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - if: steps.check_permissions.outputs.has-permission - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all - - name: Run clippy manually without annotations - if: ${{ !steps.check_permissions.outputs.has-permission }} - run: cargo clippy --all --all-features -- -D warnings + - name: Run clippy + run: cargo clippy --all --tests --all-features --examples --benches diff --git a/src/lib.rs b/src/lib.rs index f450a48..6cb9dd6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,8 +5,8 @@ use anyhow::Result; use dropshot::{ - endpoint, ApiDescription, ConfigDropshot, ConfigLogging, ConfigLoggingLevel, HttpError, - HttpResponseOk, HttpServerStarter, RequestContext, + endpoint, ApiDescription, ConfigLogging, ConfigLoggingLevel, HttpError, HttpResponseOk, + HttpServerStarter, RequestContext, }; use schemars::JsonSchema; use serde::Serialize; @@ -21,8 +21,6 @@ use os_linux as os; #[cfg(target_os = "macos")] mod os_macos; -#[cfg(target_os = "macos")] -use os_macos as os; struct Context { schema: serde_json::Value, @@ -112,8 +110,10 @@ pub fn init() -> Result<()> { let bind_address = "127.0.0.1:7132"; - let mut config_dropshot: ConfigDropshot = Default::default(); - config_dropshot.bind_address = bind_address.parse().unwrap(); + let config_dropshot = dropshot::ConfigDropshot { + bind_address: bind_address.parse().unwrap(), + ..Default::default() + }; let server = HttpServerStarter::new(&config_dropshot, api, api_context, &log) .unwrap()