Skip to content

Commit 921927f

Browse files
authored
fix clippy and macos build (#11)
* 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]>
1 parent 47b5e00 commit 921927f

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

.cargo/config.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
[build]
1+
# build on linux
2+
[build.'cfg(target_os = "linux")']
23
rustflags = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
4+
5+
# build on macos
6+
[build.'cfg(target_os = "macos")']
7+
rustflags = []

.github/workflows/cargo-clippy.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,5 @@ jobs:
3737
- name: Rust Cache
3838
uses: Swatinem/[email protected]
3939

40-
- name: Check workflow permissions
41-
id: check_permissions
42-
uses: scherermichael-oss/[email protected]
43-
with:
44-
required-permission: write
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
48-
- if: steps.check_permissions.outputs.has-permission
49-
uses: actions-rs/clippy-check@v1
50-
with:
51-
token: ${{ secrets.GITHUB_TOKEN }}
52-
args: --all
53-
- name: Run clippy manually without annotations
54-
if: ${{ !steps.check_permissions.outputs.has-permission }}
55-
run: cargo clippy --all --all-features -- -D warnings
40+
- name: Run clippy
41+
run: cargo clippy --all --tests --all-features --examples --benches

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
66
use anyhow::Result;
77
use dropshot::{
8-
endpoint, ApiDescription, ConfigDropshot, ConfigLogging, ConfigLoggingLevel, HttpError,
9-
HttpResponseOk, HttpServerStarter, RequestContext,
8+
endpoint, ApiDescription, ConfigLogging, ConfigLoggingLevel, HttpError, HttpResponseOk,
9+
HttpServerStarter, RequestContext,
1010
};
1111
use schemars::JsonSchema;
1212
use serde::Serialize;
@@ -21,8 +21,6 @@ use os_linux as os;
2121

2222
#[cfg(target_os = "macos")]
2323
mod os_macos;
24-
#[cfg(target_os = "macos")]
25-
use os_macos as os;
2624

2725
struct Context {
2826
schema: serde_json::Value,
@@ -112,8 +110,10 @@ pub fn init() -> Result<()> {
112110

113111
let bind_address = "127.0.0.1:7132";
114112

115-
let mut config_dropshot: ConfigDropshot = Default::default();
116-
config_dropshot.bind_address = bind_address.parse().unwrap();
113+
let config_dropshot = dropshot::ConfigDropshot {
114+
bind_address: bind_address.parse().unwrap(),
115+
..Default::default()
116+
};
117117

118118
let server = HttpServerStarter::new(&config_dropshot, api, api_context, &log)
119119
.unwrap()

0 commit comments

Comments
 (0)