--- /dev/null
+name: Rust
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+
+jobs:
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ steps:
+ - name: Setup | Checkout
+ uses: actions/checkout@v2
+ - name: Setup | Rust
+ uses: ATiltedTree/setup-rust@v1
+ with:
+ rust-version: stable
+ components: clippy
+ - name: Build | Lint
+ run: cargo clippy
+ compile:
+ name: Compile
+ runs-on: ubuntu-latest
+ steps:
+ - name: Setup | Checkout
+ uses: actions/checkout@v2
+ - name: Install Protoc
+ uses: arduino/setup-protoc@v1
+ - name: Setup | Rust
+ uses: ATiltedTree/setup-rust@v1
+ with:
+ rust-version: stable
+ - name: Build | Compile
+ run: cargo check
+ test:
+ name: Test
+ strategy:
+ matrix:
+ os:
+ - ubuntu-latest
+ - windows-latest
+ - macOS-latest
+ rust:
+ - stable
+ - beta
+ - nightly
+ runs-on: ${{ matrix.os }}
+ needs: [compile]
+ steps:
+ - name: Setup | Checkout
+ uses: actions/checkout@v2
+ - name: Install Protoc
+ uses: arduino/setup-protoc@v1
+ - name: Setup | Rust
+ uses: ATiltedTree/setup-rust@v1
+ with:
+ rust-version: ${{ matrix.rust }}
+ - name: Build | Compile
+ run: cargo test
+++ /dev/null
-name: Rust
-
-on:
- push:
- branches: [ "main" ]
- pull_request:
- branches: [ "main" ]
-
-env:
- CARGO_TERM_COLOR: always
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v3
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose
match value.kind {
InteractionType::Ping => Ok(Response::builder()
.header("Content-Type", "application/json")
- .body(r#"{"t":1}"#.into())
+ .body(r#"{"type":1}"#.into())
.unwrap()),
_ => {
debug!("calling nats");
{
Ok(response) => Ok(Response::builder()
.header("Content-Type", "application/json")
- .body(Body::from(response.reply.unwrap()))
+ .body(Body::from(response.payload))
.unwrap()),
Err(error) => {
}
fn call(&mut self, req: Request<Body>) -> Self::Future {
- let future =
- Self::process_request(req, self.nats.clone(), self.config.discord.public_key);
+ let future = Self::process_request(req, self.nats.clone(), self.config.discord.public_key);
Box::pin(async move {
let response = future.await;