Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change .chain() to .sources() to use new Rust #391

Merged
merged 6 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/synth-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/synth-errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/synth-mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/synth-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/synth-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/synth-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ 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
steps:
- 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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/synth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2022-08-01"
channel = "nightly"
components = [ "rustfmt", "rust-src", "llvm-tools-preview"]
3 changes: 2 additions & 1 deletion synth/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::unwrap_or_else_default)]
use serde::{Deserialize, Serialize};

pub use synth_core::error::*;
Expand Down Expand Up @@ -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<UserError> = None;
let mut chain = original.chain().collect::<Vec<_>>();
let mut chain = original.sources().collect::<Vec<_>>();
chain.reverse();
for error in chain {
match &mut final_error {
Expand Down
4 changes: 2 additions & 2 deletions synth/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion synth/src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions synth/tests/docs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::needless_borrow, clippy::explicit_counter_loop)]
use lazy_static::lazy_static;
use std::{
collections::HashSet,
Expand Down
1 change: 1 addition & 0 deletions test_macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::collapsible_str_replace)]
extern crate proc_macro;
use std::{collections::HashMap, ffi::OsStr};

Expand Down
4 changes: 2 additions & 2 deletions tools/vagrant/linux/ubuntu/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down