git.delta.rocks / jrsonnet / refs/commits / 101b513c0b09

difftreelog

build use now-stable async traits

Petr Portnov2023-10-29parent: #fd582d4.patch.diff
in: master

5 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -112,17 +112,6 @@
 ]
 
 [[package]]
-name = "async-trait"
-version = "0.1.74"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
 name = "autocfg"
 version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -598,7 +587,6 @@
 dependencies = [
  "annotate-snippets",
  "anyhow",
- "async-trait",
  "bincode",
  "derivative",
  "hashbrown 0.14.2",
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,6 @@
 rustc-hash = "1.1"
 bincode = "1.3"
 annotate-snippets = "0.9.1"
-async-trait = "0.1.60"
 num-bigint = "0.4.3"
 derivative = "2.2.0"
 strsim = "0.10.0"
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
before · crates/jrsonnet-evaluator/Cargo.toml
1[package]2name = "jrsonnet-evaluator"3description = "jsonnet interpreter"4version.workspace = true5repository.workspace = true6authors = ["Yaroslav Bolyukin <iam@lach.pw>"]7license = "MIT"8edition = "2021"910[features]11default = ["explaining-traces"]12# Rustc-like trace visualization13explaining-traces = ["annotate-snippets"]14# Allows library authors to throw custom errors15anyhow-error = ["anyhow"]16# Adds ability to build import closure in async17async-import = ["async-trait"]1819# Allows to preserve field order in objects20exp-preserve-order = []21# Implements field destructuring22exp-destruct = ["jrsonnet-parser/exp-destruct"]23# Iteration over objects yields [key, value] elements24exp-object-iteration = []25# Bigint type26exp-bigint = ["num-bigint", "jrsonnet-types/exp-bigint"]27# obj?.field, obj?.['field']28exp-null-coaelse = ["jrsonnet-parser/exp-null-coaelse"]2930# Improves performance, and implements some useful things using nightly-only features31nightly = ["hashbrown/nightly"]3233[dependencies]34jrsonnet-interner.workspace = true35jrsonnet-parser.workspace = true36jrsonnet-types.workspace = true37jrsonnet-macros.workspace = true38jrsonnet-gcmodule.workspace = true3940pathdiff.workspace = true41hashbrown.workspace = true42static_assertions.workspace = true4344rustc-hash.workspace = true4546thiserror.workspace = true47# Friendly errors48strsim.workspace = true4950serde.workspace = true5152anyhow = { workspace = true, optional = true }53# Serialized stdlib54bincode = { workspace = true, optional = true }55# Explaining traces56annotate-snippets = { workspace = true, features = ["color"], optional = true }57# Async imports58async-trait = { workspace = true, optional = true }59# Bigint60num-bigint = { workspace = true, features = ["serde"], optional = true }61derivative.workspace = true
after · crates/jrsonnet-evaluator/Cargo.toml
1[package]2name = "jrsonnet-evaluator"3description = "jsonnet interpreter"4version.workspace = true5repository.workspace = true6authors = ["Yaroslav Bolyukin <iam@lach.pw>"]7license = "MIT"8edition = "2021"910[features]11default = ["explaining-traces"]12# Rustc-like trace visualization13explaining-traces = ["annotate-snippets"]14# Allows library authors to throw custom errors15anyhow-error = ["anyhow"]16# Adds ability to build import closure in async17async-import = []1819# Allows to preserve field order in objects20exp-preserve-order = []21# Implements field destructuring22exp-destruct = ["jrsonnet-parser/exp-destruct"]23# Iteration over objects yields [key, value] elements24exp-object-iteration = []25# Bigint type26exp-bigint = ["num-bigint", "jrsonnet-types/exp-bigint"]27# obj?.field, obj?.['field']28exp-null-coaelse = ["jrsonnet-parser/exp-null-coaelse"]2930# Improves performance, and implements some useful things using nightly-only features31nightly = ["hashbrown/nightly"]3233[dependencies]34jrsonnet-interner.workspace = true35jrsonnet-parser.workspace = true36jrsonnet-types.workspace = true37jrsonnet-macros.workspace = true38jrsonnet-gcmodule.workspace = true3940pathdiff.workspace = true41hashbrown.workspace = true42static_assertions.workspace = true4344rustc-hash.workspace = true4546thiserror.workspace = true47# Friendly errors48strsim.workspace = true4950serde.workspace = true5152anyhow = { workspace = true, optional = true }53# Serialized stdlib54bincode = { workspace = true, optional = true }55# Explaining traces56annotate-snippets = { workspace = true, features = ["color"], optional = true }57# Bigint58num-bigint = { workspace = true, features = ["serde"], optional = true }59derivative.workspace = true
modifiedcrates/jrsonnet-evaluator/src/async_import.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/async_import.rs
+++ b/crates/jrsonnet-evaluator/src/async_import.rs
@@ -1,6 +1,5 @@
 use std::{cell::RefCell, path::Path};
 
-use async_trait::async_trait;
 use jrsonnet_gcmodule::Trace;
 use jrsonnet_interner::IStr;
 use jrsonnet_parser::{
@@ -218,7 +217,7 @@
 	}
 }
 
-#[async_trait(?Send)]
+#[allow(async_fn_in_trait)] // we don't care about `Send` bound
 pub trait AsyncImportResolver {
 	type Error;
 	/// Resolves file path, e.g. `(/home/user/manifests, b.libjsonnet)` can correspond
addedrust-toolchain.tomldiffbeforeafterboth
--- /dev/null
+++ b/rust-toolchain.toml
@@ -0,0 +1,3 @@
+[toolchain]
+channel = "nightly-2023-10-28"
+components = ["rustfmt", "clippy"]