From 716ffa8f399c90ee8ea405a0accbf8d21bf7f25c Mon Sep 17 00:00:00 2001 From: iamwacko Date: Thu, 10 Nov 2022 19:37:30 -0800 Subject: [PATCH 1/6] fix: change .chain() to .sources() and change CI --- .github/workflows/release.yml | 8 ++++---- .github/workflows/synth-bench.yml | 4 ++-- .github/workflows/synth-errors.yml | 4 ++-- .github/workflows/synth-mongo.yml | 2 +- .github/workflows/synth-mysql.yml | 2 +- .github/workflows/synth-postgres.yml | 2 +- .github/workflows/synth-test.yml | 4 ++-- .github/workflows/synth.yml | 2 +- docs/docs/getting_started/installation.md | 2 +- rust-toolchain | 2 +- synth/src/error.rs | 2 +- tools/vagrant/linux/ubuntu/Vagrantfile | 4 ++-- 12 files changed, 19 insertions(+), 19 deletions(-) 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/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..56f1d784 100644 --- a/synth/src/error.rs +++ b/synth/src/error.rs @@ -41,7 +41,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/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 From f5943c11409db688fa537ed3ed681df40347a218 Mon Sep 17 00:00:00 2001 From: iamwacko Date: Thu, 10 Nov 2022 19:45:24 -0800 Subject: [PATCH 2/6] fix: map_first_last feature is now stable --- core/src/lib.rs | 2 +- synth/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 52f3d511..20786501 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(map_first_last, box_patterns, error_iter, try_blocks)] +#![feature(box_patterns, error_iter, try_blocks)] #![allow(type_alias_bounds)] #[macro_export] diff --git a/synth/src/lib.rs b/synth/src/lib.rs index 70b00967..b454ff94 100644 --- a/synth/src/lib.rs +++ b/synth/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(map_first_last, box_patterns, concat_idents, error_iter)] +#![feature(box_patterns, concat_idents, error_iter)] #![allow(type_alias_bounds)] #[macro_use] From 16dd3d7d08a099989beb16306e44fb044156265e Mon Sep 17 00:00:00 2001 From: iamwacko Date: Sun, 13 Nov 2022 20:57:52 -0800 Subject: [PATCH 3/6] chore: supress clippy errors --- core/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 20786501..88c9142c 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,5 +1,5 @@ #![feature(box_patterns, error_iter, try_blocks)] -#![allow(type_alias_bounds)] +#![allow(type_alias_bounds, result_large_err, unwrap_or_else_default)] #[macro_export] macro_rules! derive_generator { From f0adfc2a9abf35bbedd68fb3ad9f969fe6310c61 Mon Sep 17 00:00:00 2001 From: iamwacko Date: Sun, 13 Nov 2022 21:15:44 -0800 Subject: [PATCH 4/6] fix: fixed typo --- core/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 88c9142c..9c4c6dab 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,5 +1,5 @@ #![feature(box_patterns, error_iter, try_blocks)] -#![allow(type_alias_bounds, result_large_err, unwrap_or_else_default)] +#![allow(type_alias_bounds, clippy::result_large_err, clippy::unwrap_or_else_default)] #[macro_export] macro_rules! derive_generator { From b88d0360ac4c1028b698b270d09b9c415e281b4c Mon Sep 17 00:00:00 2001 From: iamwacko Date: Mon, 14 Nov 2022 06:37:17 -0800 Subject: [PATCH 5/6] chore: cargo fmt and clippy --- core/src/lib.rs | 6 +++++- synth/src/error.rs | 1 + synth/src/lib.rs | 2 +- synth/src/sampler.rs | 2 +- test_macros/src/lib.rs | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 9c4c6dab..777d381d 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,5 +1,9 @@ #![feature(box_patterns, error_iter, try_blocks)] -#![allow(type_alias_bounds, clippy::result_large_err, clippy::unwrap_or_else_default)] +#![allow( + type_alias_bounds, + clippy::result_large_err, + clippy::unwrap_or_else_default +)] #[macro_export] macro_rules! derive_generator { diff --git a/synth/src/error.rs b/synth/src/error.rs index 56f1d784..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::*; diff --git a/synth/src/lib.rs b/synth/src/lib.rs index b454ff94..59c6b644 100644 --- a/synth/src/lib.rs +++ b/synth/src/lib.rs @@ -1,5 +1,5 @@ #![feature(box_patterns, concat_idents, error_iter)] -#![allow(type_alias_bounds)] +#![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/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}; From 22cc160b5a4c83f6d1da4bdf93ed28d6130eaa1a Mon Sep 17 00:00:00 2001 From: iamwacko Date: Mon, 14 Nov 2022 06:52:36 -0800 Subject: [PATCH 6/6] chore: clippy --- synth/tests/docs.rs | 1 + 1 file changed, 1 insertion(+) 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,