This is a non-breaking change to make the from_stub constructor for client. We can make it more usable if it accepts Into<Arc<T>>:
use std::sync::Arc;
pub struct Foo<T> {
inner: Arc<T>
}
impl<T> Foo<T> {
pub fn from<U>(v: U) -> Self
where U: Into<Arc<T>> {
Self { inner: v.into() }
}
pub fn use_inner(&self) -> T where T: Clone {
(*self.inner).clone()
}
}
pub fn from_str(a: String) -> Foo<String> {
Foo::from(a)
}
pub fn from_arc(a: Arc<String>) -> Foo<String> {
Foo::from(a)
}
This is a non-breaking change to make the
from_stubconstructor for client. We can make it more usable if it acceptsInto<Arc<T>>: