Skip to content

Commit 36e7e3f

Browse files
committed
revert loosening of kv cargo features
1 parent 2282191 commit 36e7e3f

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ release_max_level_info = []
4444
release_max_level_debug = []
4545
release_max_level_trace = []
4646

47-
std = ["value-bag?/std"]
47+
std = []
4848

4949
kv = []
5050
kv_sval = ["kv", "value-bag/sval", "sval", "sval_ref"]

src/kv/value.rs

+8-17
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl<'v> Value<'v> {
385385
}
386386
}
387387

388-
#[cfg(feature = "std")]
388+
#[cfg(feature = "kv_std")]
389389
mod std_support {
390390
use std::borrow::Cow;
391391
use std::rc::Rc;
@@ -432,29 +432,20 @@ mod std_support {
432432
}
433433
}
434434

435+
impl<'v> Value<'v> {
436+
/// Try convert this value into a string.
437+
pub fn to_cow_str(&self) -> Option<Cow<'v, str>> {
438+
self.inner.to_str()
439+
}
440+
}
441+
435442
impl<'v> From<&'v String> for Value<'v> {
436443
fn from(v: &'v String) -> Self {
437444
Value::from(&**v)
438445
}
439446
}
440447
}
441448

442-
#[cfg(all(feature = "std", feature = "value-bag"))]
443-
impl<'v> Value<'v> {
444-
/// Try to convert this value into a string.
445-
pub fn to_cow_str(&self) -> Option<std::borrow::Cow<'v, str>> {
446-
self.inner.to_str()
447-
}
448-
}
449-
450-
#[cfg(all(feature = "std", not(feature = "value-bag")))]
451-
impl<'v> Value<'v> {
452-
/// Try to convert this value into a string.
453-
pub fn to_cow_str(&self) -> Option<std::borrow::Cow<'v, str>> {
454-
self.inner.to_borrowed_str().map(std::borrow::Cow::Borrowed)
455-
}
456-
}
457-
458449
/// A visitor for a [`Value`].
459450
///
460451
/// Also see [`Value`'s documentation on seralization]. Value visitors are a simple alternative

0 commit comments

Comments
 (0)