diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 541b4a6e..9382f538 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - id: tag uses: dawidd6/action-get-tag@v1 - run: cargo build --release --features telemetry --bin synth @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly target: aarch64-unknown-linux-musl override: true - id: tag @@ -90,7 +90,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - id: tag uses: dawidd6/action-get-tag@v1 - run: cargo build --release --features telemetry --bin synth @@ -109,7 +109,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - id: tag uses: dawidd6/action-get-tag@v1 - id: version diff --git a/.github/workflows/synth-bench.yml b/.github/workflows/synth-bench.yml index 042f8007..20c2df7c 100644 --- a/.github/workflows/synth-bench.yml +++ b/.github/workflows/synth-bench.yml @@ -19,12 +19,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - uses: actions/setup-python@v2 - name: run benchmark id: bench run: | - body=$(cargo +nightly-2022-08-01 bench --manifest-path /home/runner/work/synth/synth/synth/Cargo.toml) + body=$(cargo +nightly bench --manifest-path /home/runner/work/synth/synth/synth/Cargo.toml) body="${body//'%'/'%25'}" body="${body//$'\n'/'%0A'}" body="${body//$'\r'/'%0D'}" diff --git a/.github/workflows/synth-errors.yml b/.github/workflows/synth-errors.yml index 0be405c4..06021a5a 100644 --- a/.github/workflows/synth-errors.yml +++ b/.github/workflows/synth-errors.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 - - run: cargo +nightly-2022-08-01 install --locked --debug --path=synth + toolchain: nightly + - run: cargo +nightly install --locked --debug --path=synth - run: ./e2e.sh working-directory: synth/testing_harness/errors diff --git a/.github/workflows/synth-mongo.yml b/.github/workflows/synth-mongo.yml index 4e73dc86..0c3d581c 100644 --- a/.github/workflows/synth-mongo.yml +++ b/.github/workflows/synth-mongo.yml @@ -24,7 +24,7 @@ jobs: docker run -p $PORT:27017 --name mongo-synth-harness -d mongo:latest - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - run: cargo install --locked --debug --path=synth - run: ./e2e.sh test-generate working-directory: synth/testing_harness/mongodb diff --git a/.github/workflows/synth-mysql.yml b/.github/workflows/synth-mysql.yml index e86cfd80..4503ba9f 100644 --- a/.github/workflows/synth-mysql.yml +++ b/.github/workflows/synth-mysql.yml @@ -61,7 +61,7 @@ jobs: sudo apt-get install --yes --no-install-recommends jq - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - run: cargo install --locked --debug --path=synth - run: ./e2e.sh test-generate working-directory: synth/testing_harness/mysql diff --git a/.github/workflows/synth-postgres.yml b/.github/workflows/synth-postgres.yml index a10afb54..4f4ac9e9 100644 --- a/.github/workflows/synth-postgres.yml +++ b/.github/workflows/synth-postgres.yml @@ -38,7 +38,7 @@ jobs: sudo apt-get install --yes --no-install-recommends jq - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - run: cargo install --locked --debug --path=synth - run: ./e2e.sh test-generate working-directory: synth/testing_harness/postgres diff --git a/.github/workflows/synth-test.yml b/.github/workflows/synth-test.yml index 73b37ec5..c505f1a3 100644 --- a/.github/workflows/synth-test.yml +++ b/.github/workflows/synth-test.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - run: cargo test clippy_test: runs-on: ubuntu-latest @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly components: clippy - run: cargo clippy --tests --all-targets -- -D warnings fmt_test: diff --git a/.github/workflows/synth.yml b/.github/workflows/synth.yml index 0c2fdea5..005288d7 100644 --- a/.github/workflows/synth.yml +++ b/.github/workflows/synth.yml @@ -16,5 +16,5 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2022-08-01 + toolchain: nightly - run: cargo test diff --git a/core/src/lib.rs b/core/src/lib.rs index 52f3d511..777d381d 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,5 +1,9 @@ -#![feature(map_first_last, box_patterns, error_iter, try_blocks)] -#![allow(type_alias_bounds)] +#![feature(box_patterns, error_iter, try_blocks)] +#![allow( + type_alias_bounds, + clippy::result_large_err, + clippy::unwrap_or_else_default +)] #[macro_export] macro_rules! derive_generator { diff --git a/docs/docs/getting_started/installation.md b/docs/docs/getting_started/installation.md index dc63795c..6bd9999f 100644 --- a/docs/docs/getting_started/installation.md +++ b/docs/docs/getting_started/installation.md @@ -73,7 +73,7 @@ SYNTH_TMP=$(mktemp); \ To get started, make sure you have a recent version of the [Rust nightly toolchain](https://www.rust-lang.org/tools/install). Then run: ```bash -cargo +nightly-2022-08-01 install --locked --git https://github.com/getsynth/synth.git synth +cargo +nightly install --locked --git https://github.com/getsynth/synth.git synth ``` :::note diff --git a/rust-toolchain b/rust-toolchain index d15de132..a13622fc 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2022-08-01" +channel = "nightly" components = [ "rustfmt", "rust-src", "llvm-tools-preview"] diff --git a/synth/src/error.rs b/synth/src/error.rs index 05713c8d..1d009f4e 100644 --- a/synth/src/error.rs +++ b/synth/src/error.rs @@ -1,3 +1,4 @@ +#![allow(clippy::unwrap_or_else_default)] use serde::{Deserialize, Serialize}; pub use synth_core::error::*; @@ -41,7 +42,7 @@ impl UserError { impl From<&(dyn std::error::Error + 'static)> for UserError { fn from(original: &(dyn std::error::Error + 'static)) -> Self { let mut final_error: Option = None; - let mut chain = original.chain().collect::>(); + let mut chain = original.sources().collect::>(); chain.reverse(); for error in chain { match &mut final_error { diff --git a/synth/src/lib.rs b/synth/src/lib.rs index 70b00967..59c6b644 100644 --- a/synth/src/lib.rs +++ b/synth/src/lib.rs @@ -1,5 +1,5 @@ -#![feature(map_first_last, box_patterns, concat_idents, error_iter)] -#![allow(type_alias_bounds)] +#![feature(box_patterns, concat_idents, error_iter)] +#![allow(type_alias_bounds, clippy::needless_borrow)] #[macro_use] extern crate log; diff --git a/synth/src/sampler.rs b/synth/src/sampler.rs index 5ab74eb9..b353cd50 100644 --- a/synth/src/sampler.rs +++ b/synth/src/sampler.rs @@ -34,7 +34,7 @@ impl SamplerOutput { } fn sampler_progress_bar(target: u64) -> ProgressBar { - let bar = ProgressBar::new(target as u64); + let bar = ProgressBar::new(target); let style = ProgressStyle::default_bar() .template("[{elapsed_precise}] {wide_bar} {pos}/{len} generated ({eta} remaining)"); bar.set_style(style); diff --git a/synth/tests/docs.rs b/synth/tests/docs.rs index 0e5f96a2..2d7bf1a6 100644 --- a/synth/tests/docs.rs +++ b/synth/tests/docs.rs @@ -1,3 +1,4 @@ +#![allow(clippy::needless_borrow, clippy::explicit_counter_loop)] use lazy_static::lazy_static; use std::{ collections::HashSet, diff --git a/test_macros/src/lib.rs b/test_macros/src/lib.rs index 6a95b7ec..bd811062 100644 --- a/test_macros/src/lib.rs +++ b/test_macros/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::collapsible_str_replace)] extern crate proc_macro; use std::{collections::HashMap, ffi::OsStr}; diff --git a/tools/vagrant/linux/ubuntu/Vagrantfile b/tools/vagrant/linux/ubuntu/Vagrantfile index 34035324..25b01eaa 100644 --- a/tools/vagrant/linux/ubuntu/Vagrantfile +++ b/tools/vagrant/linux/ubuntu/Vagrantfile @@ -26,9 +26,9 @@ Vagrant.configure("2") do |config| apt-get update apt-get install -y build-essential pkg-config libssl-dev jq source ~/.profile - rustup toolchain install nightly-2022-08-01 + rustup toolchain install nightly cd $2 - /root/.cargo/bin/cargo +nightly-2022-08-01 install --debug --path=synth + /root/.cargo/bin/cargo +nightly install --debug --path=synth SHELL # Install Docker