From 2e9049b8916d9c4bf9813cc3edae0ab4a470a5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Sun, 2 Feb 2025 09:08:55 +0100 Subject: [PATCH] Remove all default features. Making them opt-in --- Cargo.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5e1b890..ebc13d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,9 +17,12 @@ edition = "2021" rust-version = "1.60.0" [features] -# TODO: Remove the default features on next breaking release and make them opt-in. -# Because default features are evil -default = ["std", "async"] +# None of the features are on by default, by design. Default features is an anti-pattern. +# Since most people pull in dependencies without carefully inspecting the dependency or +# feature list, they accidentally pull in unnecessary complexity and sometimes even +# dependencies. By making everything opt-in, we avoid this problem. Opting in to a feature +# is so simple in Cargo anyway, and makes it more explicit what functionality it uses. +default = [] # Enables usage of libstd. Adds support for thread blocking receive methods. std = []