mirror of
https://github.com/enso-org/enso.git
synced 2024-12-27 22:53:17 +03:00
removing optional dependencies from prelude (#3922)
This commit is contained in:
parent
e31e3ccefb
commit
717325f472
@ -11,10 +11,7 @@ crate-type = ["cdylib", "rlib"]
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
enso-data-structures = { path = "../../../../lib/rust/data-structures" }
|
||||
enso-logger = { path = "../../../../lib/rust/logger" }
|
||||
enso-prelude = { path = "../../../../lib/rust/prelude", features = [
|
||||
"serde",
|
||||
"serde_json"
|
||||
] }
|
||||
enso-prelude = { path = "../../../../lib/rust/prelude" }
|
||||
enso-shapely = { path = "../../../../lib/rust/shapely" }
|
||||
enso-text = { path = "../../../../lib/rust/text" }
|
||||
failure = { version = "0.1.8" }
|
||||
|
@ -11,10 +11,7 @@ crate-type = ["cdylib", "rlib"]
|
||||
[dependencies]
|
||||
ast = { path = "../ast/impl" }
|
||||
enso-data-structures = { path = "../../../../lib/rust/data-structures" }
|
||||
enso-prelude = { path = "../../../../lib/rust/prelude", features = [
|
||||
"serde",
|
||||
"serde_json"
|
||||
] }
|
||||
enso-prelude = { path = "../../../../lib/rust/prelude" }
|
||||
enso-profiler = { path = "../../../../lib/rust/profiler" }
|
||||
enso-text = { path = "../../../../lib/rust/text" }
|
||||
console_error_panic_hook = { version = "0.1.6" }
|
||||
|
@ -15,7 +15,7 @@ bimap = { version = "0.4.0" }
|
||||
enso-config = { version = "0.1.0", path = "../../config" }
|
||||
enso-frp = { version = "0.1.0", path = "../../../../lib/rust/frp" }
|
||||
enso-logger = { path = "../../../../lib/rust/logger" }
|
||||
enso-prelude = { path = "../../../../lib/rust/prelude", features = ["serde"] }
|
||||
enso-prelude = { path = "../../../../lib/rust/prelude" }
|
||||
engine-protocol = { version = "0.1.0", path = "../../controller/engine-protocol" }
|
||||
enso-shapely = { path = "../../../../lib/rust/shapely" }
|
||||
enso-text = { version = "0.1.0", path = "../../../../lib/rust/text" }
|
||||
|
@ -8,7 +8,7 @@ edition = "2021"
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
enso-prelude = { path = "../prelude", features = ["futures"] }
|
||||
enso-prelude = { path = "../prelude" }
|
||||
enso-shapely = { path = "../shapely" }
|
||||
enso-web = { path = "../web" }
|
||||
enso-profiler-data = { path = "../profiler/data" }
|
||||
|
@ -10,7 +10,7 @@ repository = "https://github.com/enso-org/enso"
|
||||
license-file = "../../LICENSE"
|
||||
|
||||
[dependencies]
|
||||
enso-prelude = { path = "../prelude", features = ["serde", "serde_json"] }
|
||||
enso-prelude = { path = "../prelude" }
|
||||
enso-reflect = { path = "../reflect" }
|
||||
enso-data-structures = { path = "../data-structures" }
|
||||
enso-types = { path = "../types" }
|
||||
|
@ -11,7 +11,7 @@ license-file = "../../LICENSE"
|
||||
|
||||
[dependencies]
|
||||
enso-metamodel = { path = "../../metamodel", features = ["rust", "java"] }
|
||||
enso-prelude = { path = "../../prelude", features = ["serde"] }
|
||||
enso-prelude = { path = "../../prelude" }
|
||||
enso-parser = { path = ".." }
|
||||
enso-reflect = { path = "../../reflect", features = ["graphviz"] }
|
||||
derivative = "2.2"
|
||||
|
@ -28,7 +28,7 @@ derivative = "2.2.0"
|
||||
derive_more = "0.99"
|
||||
enclose = "1.1.8"
|
||||
failure = "0.1.5"
|
||||
futures = { version = "0.3.1", optional = true }
|
||||
futures = { version = "0.3.1" }
|
||||
ifmt = "0.3.3"
|
||||
itertools = "0.10.0"
|
||||
lazy_static = "1.4"
|
||||
@ -36,13 +36,13 @@ num = "0.4.0"
|
||||
object = { version = "0.24.0" }
|
||||
paste = "1.0"
|
||||
shrinkwraprs = "0.3.0"
|
||||
serde = { version = "1.0.126", features = ["derive", "rc"], optional = true }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
serde = { version = "1.0.126", features = ["derive", "rc"] }
|
||||
serde_json = { version = "1.0" }
|
||||
smallvec = "1.0.0"
|
||||
tracing = { version = "0.1.37", features = ["log"] }
|
||||
tracing-subscriber = "0.3"
|
||||
tracing-wasm = "0.2"
|
||||
wasm-bindgen = { version = "0.2.78", features = ["nightly"], optional = true }
|
||||
wasm-bindgen = { version = "0.2.78", features = ["nightly"] }
|
||||
weak-table = "0.3.0"
|
||||
enso-web = { path = "../web" }
|
||||
gen-iter = "0.2.1"
|
||||
|
@ -18,8 +18,8 @@ use std::vec::Drain;
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Deref, DerefMut, Reflect)]
|
||||
#[reflect(transparent)]
|
||||
#[cfg_attr(feature = "serde", derive(crate::serde_reexports::Serialize))]
|
||||
#[cfg_attr(feature = "serde", derive(crate::serde_reexports::Deserialize))]
|
||||
#[derive(crate::serde_reexports::Serialize)]
|
||||
#[derive(crate::serde_reexports::Deserialize)]
|
||||
pub struct NonEmptyVec<T, I = usize> {
|
||||
#[reflect(as = "Vec<T>")]
|
||||
pub elems: VecIndexedBy<T, I>,
|
||||
|
@ -34,8 +34,8 @@ macro_rules! ranged_fn {
|
||||
|
||||
pub trait Index = Copy + From<usize> + Into<usize>;
|
||||
|
||||
#[cfg_attr(feature = "serde", derive(crate::serde_reexports::Serialize))]
|
||||
#[cfg_attr(feature = "serde", derive(crate::serde_reexports::Deserialize))]
|
||||
#[derive(crate::serde_reexports::Serialize)]
|
||||
#[derive(crate::serde_reexports::Deserialize)]
|
||||
#[derive(Derivative, Deref, DerefMut, From, Into)]
|
||||
#[derivative(Clone(bound = "T: Clone, A: Allocator + Clone"))]
|
||||
#[derivative(Debug(bound = "T: Debug, A: Allocator"))]
|
||||
@ -43,13 +43,10 @@ pub trait Index = Copy + From<usize> + Into<usize>;
|
||||
#[derivative(PartialEq(bound = "Vec<T, A>: PartialEq"))]
|
||||
#[derivative(Eq(bound = "Vec<T, A>: PartialEq"))]
|
||||
pub struct VecIndexedBy<T, I = usize, A: Allocator = std::alloc::Global> {
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
serde(bound(
|
||||
serialize = "Vec<T, A>: crate::serde_reexports::Serialize",
|
||||
deserialize = "Vec<T, A>: crate::serde_reexports::Deserialize<'de>"
|
||||
))
|
||||
)]
|
||||
#[serde(bound(
|
||||
serialize = "Vec<T, A>: crate::serde_reexports::Serialize",
|
||||
deserialize = "Vec<T, A>: crate::serde_reexports::Deserialize<'de>"
|
||||
))]
|
||||
#[deref]
|
||||
#[deref_mut]
|
||||
vec: Vec<T, A>,
|
||||
|
@ -24,14 +24,12 @@
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
mod bool;
|
||||
#[cfg(feature = "futures")]
|
||||
pub mod channel;
|
||||
mod collections;
|
||||
mod data;
|
||||
pub mod debug;
|
||||
pub mod env;
|
||||
mod fail;
|
||||
#[cfg(feature = "futures")]
|
||||
pub mod future;
|
||||
mod leak;
|
||||
mod macros;
|
||||
@ -42,7 +40,6 @@ mod range;
|
||||
mod rc;
|
||||
mod reference;
|
||||
mod result;
|
||||
#[cfg(feature = "serde")]
|
||||
mod serde;
|
||||
mod smallvec;
|
||||
mod std_reexports;
|
||||
@ -54,7 +51,6 @@ mod vec;
|
||||
mod wrapper;
|
||||
|
||||
pub use crate::bool::*;
|
||||
#[cfg(feature = "serde")]
|
||||
pub use crate::serde::*;
|
||||
pub use crate::smallvec::*;
|
||||
pub use anyhow;
|
||||
@ -133,7 +129,6 @@ pub mod std_ext {
|
||||
///
|
||||
/// They cannot be directly reexported from prelude, as the methods `serialize` and `deserialize`
|
||||
/// that would be brought into scope by this, would collide with the other IDE-defined traits.
|
||||
#[cfg(feature = "serde")]
|
||||
pub mod serde_reexports {
|
||||
pub use serde::Deserialize;
|
||||
pub use serde::Serialize;
|
||||
|
@ -1,13 +1,11 @@
|
||||
//! Module for utilities related to serialization/deserialization using the `serde` library.
|
||||
|
||||
#[cfg(feature = "serde_json")]
|
||||
use serde::Deserialize;
|
||||
|
||||
|
||||
|
||||
/// Try to deserialize value of type `Ret`. In case of any error, it is ignored and the default
|
||||
/// value is returned instead.
|
||||
#[cfg(feature = "serde_json")]
|
||||
pub fn deserialize_or_default<'d, Ret, D>(d: D) -> Result<Ret, D::Error>
|
||||
where
|
||||
for<'e> Ret: Default + Deserialize<'e>,
|
||||
@ -41,7 +39,6 @@ where
|
||||
/// check_deserialized_eq(r#"{"blah" : [] }"#, &empty_foo);
|
||||
/// check_deserialized_eq(r#"{"blah" : [1,2,3] }"#, &Foo { blah: vec![1, 2, 3] });
|
||||
/// ```
|
||||
#[cfg(feature = "serde_json")]
|
||||
pub fn deserialize_null_as_default<'d, Ret, D>(d: D) -> Result<Ret, D::Error>
|
||||
where
|
||||
for<'e> Ret: Default + Deserialize<'e>,
|
||||
|
@ -7,9 +7,7 @@ use itertools::*;
|
||||
|
||||
use crate::impls;
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Deserialize;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
use std::borrow::Cow;
|
||||
use std::ops::Deref;
|
||||
@ -102,7 +100,7 @@ impl AsRef<str> for CowString {
|
||||
|
||||
/// Immutable string implementation with a fast clone implementation.
|
||||
#[derive(Clone, CloneRef, Default, Eq, Hash, PartialEq, Ord, PartialOrd)]
|
||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct ImString {
|
||||
content: Rc<String>,
|
||||
}
|
||||
@ -286,16 +284,6 @@ impl ToImString for &str {
|
||||
// === Macros ===
|
||||
|
||||
/// Defines a newtype for `ImString`.
|
||||
#[cfg(not(feature = "serde"))]
|
||||
#[macro_export]
|
||||
macro_rules! im_string_newtype {
|
||||
($($(#$meta:tt)* $name:ident),* $(,)?) => {
|
||||
im_string_newtype_without_serde!{ $($(#$meta)* $name),* }
|
||||
};
|
||||
}
|
||||
|
||||
/// Defines a newtype for `ImString`.
|
||||
#[cfg(feature = "serde")]
|
||||
#[macro_export]
|
||||
macro_rules! im_string_newtype {
|
||||
($($(#$meta:tt)* $name:ident),* $(,)?) => {
|
||||
|
@ -5,20 +5,15 @@
|
||||
// === Export ===
|
||||
// ==============
|
||||
|
||||
#[cfg(feature = "futures")]
|
||||
pub mod future;
|
||||
#[cfg(feature = "futures")]
|
||||
pub mod stream;
|
||||
|
||||
|
||||
|
||||
/// Traits providing helper methods for test code.
|
||||
pub mod traits {
|
||||
#[cfg(feature = "futures")]
|
||||
pub use super::future::FutureResultTestExt;
|
||||
#[cfg(feature = "futures")]
|
||||
pub use super::future::FutureTestExt;
|
||||
#[cfg(feature = "futures")]
|
||||
pub use super::stream::StreamTestExt;
|
||||
pub use super::ExpectTuple;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ enso-reflect = { path = "../reflect" }
|
||||
nalgebra = { version = "0.26.1" }
|
||||
num-traits = { version = "0.2" }
|
||||
paste = "1.0.7"
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
enso-prelude = { path = "../prelude" }
|
||||
|
||||
[build-dependencies]
|
||||
|
@ -97,7 +97,7 @@ pub trait Variant {
|
||||
/// Internal representation of every unit.
|
||||
#[repr(transparent)]
|
||||
#[derive(Reflect)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[reflect(transparent)]
|
||||
pub struct UnitData<V, R> {
|
||||
repr: R,
|
||||
@ -520,7 +520,7 @@ macro_rules! define {
|
||||
pub type $name = $crate::unit2::Unit<[<$name:snake:upper>]>;
|
||||
$(#$meta)*
|
||||
#[derive(Debug, Clone, Copy, Reflect)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
pub struct [<$name:snake:upper>];
|
||||
|
||||
impl $crate::unit2::Variant for [<$name:snake:upper>] {
|
||||
|
Loading…
Reference in New Issue
Block a user