Skip to content

Commit

Permalink
Merge pull request #1238 from jasger9000/main
Browse files Browse the repository at this point in the history
zv: Add missing From implementations for Value::Str
  • Loading branch information
zeenix authored Feb 2, 2025
2 parents 07fafb1 + f93632f commit b0b88ce
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions zvariant/src/into_value.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, hash::BuildHasher};
use std::{borrow::Cow, collections::HashMap, hash::BuildHasher, sync::Arc};

#[cfg(feature = "gvariant")]
use crate::Maybe;
Expand Down Expand Up @@ -49,6 +49,10 @@ into_value_from_both!(i64, I64);
into_value_from_both!(f32, F64);
into_value_from_both!(f64, F64);

into_value!(Arc<str>, Str);
into_value!(Cow<'a, str>, Str);
into_value_from_both!(String, Str);

into_value_from_both!(&'a str, Str);
into_value_from_both!(Str<'a>, Str);
into_value_from_both!(ObjectPath<'a>, ObjectPath);
Expand Down Expand Up @@ -78,12 +82,6 @@ into_value!(Fd<'a>, Fd);
#[cfg(unix)]
try_into_value_from_ref!(Fd<'a>, Fd);

impl From<String> for Value<'_> {
fn from(v: String) -> Self {
Value::Str(crate::Str::from(v))
}
}

impl<'v, 's: 'v, T> From<T> for Value<'v>
where
T: Into<Structure<'s>>,
Expand Down Expand Up @@ -133,12 +131,6 @@ where
}
}

impl<'v> From<&'v String> for Value<'v> {
fn from(v: &'v String) -> Value<'v> {
Value::Str(v.into())
}
}

impl<'v, V> From<Optional<V>> for Value<'v>
where
V: Into<Value<'v>> + NoneValue<NoneType = V>,
Expand Down

0 comments on commit b0b88ce

Please sign in to comment.