Skip to content

Commit

Permalink
fix clippy and macos build (#11)
Browse files Browse the repository at this point in the history
* fix clippy and macos build'

Signed-off-by: Jess Frazelle <[email protected]>

* updates

Signed-off-by: Jess Frazelle <[email protected]>

---------

Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz authored Oct 11, 2024
1 parent 47b5e00 commit 921927f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
7 changes: 6 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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 = []
18 changes: 2 additions & 16 deletions .github/workflows/cargo-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,5 @@ jobs:
- name: Rust Cache
uses: Swatinem/[email protected]

- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/[email protected]
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
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 921927f

Please sign in to comment.