-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rust-playground/updates
- Loading branch information
Showing
36 changed files
with
327 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Lint & Test | ||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
platform: [macos-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Rust Stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install Cargo | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache cargo registry | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Cache cargo index | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Cache cargo build | ||
uses: actions/cache@v1 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Lint | ||
uses: actions-rs/clippy@master | ||
with: | ||
args: --all-features --all-targets | ||
|
||
- name: Test | ||
run: cargo test --all-features |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
use snafu::Snafu; | ||
|
||
use thiserror::Error; | ||
pub type Result<T, E = Error> = std::result::Result<T, E>; | ||
|
||
#[derive(Debug, Snafu)] | ||
#[derive(Debug, Error)] | ||
pub enum Error { | ||
#[snafu(display("Database error: {}", err))] | ||
HTTP { err: String }, | ||
|
||
#[snafu(display("Reqwest error: {}", err))] | ||
ReqwestError { err: reqwest::Error }, | ||
} | ||
#[error("HTTP error: {}", _0)] | ||
Http(String), | ||
|
||
impl From<reqwest::Error> for Error { | ||
fn from(err: reqwest::Error) -> Self { | ||
Error::ReqwestError { err: err } | ||
} | ||
#[error(transparent)] | ||
ReqwestError(#[from] reqwest::Error), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
use snafu::Snafu; | ||
use thiserror::Error; | ||
|
||
pub type Result<T, E = Error> = std::result::Result<T, E>; | ||
|
||
#[derive(Debug, Snafu)] | ||
#[derive(Debug, Error)] | ||
pub enum Error { | ||
#[snafu(display("Database error: {}", err))] | ||
Sqlite { err: String }, | ||
} | ||
|
||
impl From<rusqlite::Error> for Error { | ||
fn from(err: rusqlite::Error) -> Self { | ||
Error::Sqlite { | ||
err: err.to_string(), | ||
} | ||
} | ||
#[error(transparent)] | ||
Sqlite(#[from] rusqlite::Error), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.