1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-05-09 16:10:42 +00:00

ci: include openapi_type crate

This commit is contained in:
Dominic 2021-03-09 19:55:04 +01:00
parent ebea39fe0d
commit 3a3f743369
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
3 changed files with 30 additions and 4 deletions

View file

@ -16,6 +16,8 @@ error[E0599]: no function or associated item named `schema` found for struct `Fo
= note: the method `schema` exists but the following trait bounds were not satisfied:
`Bar: OpenapiType`
which is required by `Foo<Bar>: OpenapiType`
`Foo<Bar>: OpenapiType`
which is required by `&Foo<Bar>: OpenapiType`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `schema`, perhaps you need to implement it:
candidate #1: `OpenapiType`

View file

@ -0,0 +1,21 @@
#!/bin/busybox ash
set -euo pipefail
rustfmt=${RUSTFMT:-rustfmt}
version="$($rustfmt -V)"
case "$version" in
*nightly*)
# all good, no additional flags required
;;
*)
# assume we're using some sort of rustup setup
rustfmt="$rustfmt +nightly"
;;
esac
return=0
find "$(dirname "$0")" -name '*.rs' -type f | while read file; do
$rustfmt --config-path "$(dirname "$0")/../../../rustfmt.toml" "$@" "$file" || return=1
done
exit $return