|
@@ -85,7 +85,7 @@ pub enum EntityKey {
|
|
|
}
|
|
|
|
|
|
impl EntityKey {
|
|
|
- fn to_string_vec(vec: &Vec<Self>, ic: &impl InterfaceCustomization) -> Vec<String> {
|
|
|
+ fn to_string_vec(vec: &[Self], ic: &impl InterfaceCustomization) -> Vec<String> {
|
|
|
vec.iter()
|
|
|
.map(|v| match v {
|
|
|
EntityKey::UserInput(s) => s.to_owned(),
|
|
@@ -237,14 +237,12 @@ impl<'l, Error: CLIError> Attacher<'l, Error> {
|
|
|
Ok(None) => {
|
|
|
self.err = Some(Error::no_such_entity(
|
|
|
E::entity_name(),
|
|
|
- format!(
|
|
|
- "{}",
|
|
|
- self.remote_keys
|
|
|
- .iter()
|
|
|
- .cloned()
|
|
|
- .reduce(|a, b| format!("{},{}", a, b))
|
|
|
- .unwrap()
|
|
|
- ),
|
|
|
+ self.remote_keys
|
|
|
+ .iter()
|
|
|
+ .cloned()
|
|
|
+ .reduce(|a, b| format!("{},{}", a, b))
|
|
|
+ .unwrap()
|
|
|
+ .to_string(),
|
|
|
));
|
|
|
}
|
|
|
Err(e) => {
|
|
@@ -348,14 +346,12 @@ impl<O: CLIObject, IC: InterfaceCustomization> ClapInterface<O, IC> {
|
|
|
.get()?
|
|
|
.ok_or(<O::Error>::no_such_entity(
|
|
|
O::entity_name(),
|
|
|
- format!(
|
|
|
- "{}",
|
|
|
- local_keys
|
|
|
- .iter()
|
|
|
- .cloned()
|
|
|
- .reduce(|a, b| format!("{},{}", a, b))
|
|
|
- .unwrap()
|
|
|
- ),
|
|
|
+ local_keys
|
|
|
+ .iter()
|
|
|
+ .cloned()
|
|
|
+ .reduce(|a, b| format!("{},{}", a, b))
|
|
|
+ .unwrap()
|
|
|
+ .to_string(),
|
|
|
))?;
|
|
|
|
|
|
let mut attacher = Attacher {
|
|
@@ -396,14 +392,12 @@ impl<O: CLIObject, IC: InterfaceCustomization> ClapInterface<O, IC> {
|
|
|
.get()?
|
|
|
.ok_or(<O::Error>::no_such_entity(
|
|
|
O::entity_name(),
|
|
|
- format!(
|
|
|
- "{}",
|
|
|
- local_keys
|
|
|
- .iter()
|
|
|
- .cloned()
|
|
|
- .reduce(|a, b| format!("{},{}", a, b))
|
|
|
- .unwrap()
|
|
|
- ),
|
|
|
+ local_keys
|
|
|
+ .iter()
|
|
|
+ .cloned()
|
|
|
+ .reduce(|a, b| format!("{},{}", a, b))
|
|
|
+ .unwrap()
|
|
|
+ .to_string(),
|
|
|
))?;
|
|
|
|
|
|
let mut attacher = Attacher {
|
|
@@ -437,13 +431,11 @@ impl<O: CLIObject, IC: InterfaceCustomization> ClapInterface<O, IC> {
|
|
|
.get()?
|
|
|
.ok_or(<O::Error>::no_such_entity(
|
|
|
O::entity_name(),
|
|
|
- format!(
|
|
|
- "{}",
|
|
|
- keys.iter()
|
|
|
- .cloned()
|
|
|
- .reduce(|a, b| format!("{},{}", a, b))
|
|
|
- .unwrap()
|
|
|
- ),
|
|
|
+ keys.iter()
|
|
|
+ .cloned()
|
|
|
+ .reduce(|a, b| format!("{},{}", a, b))
|
|
|
+ .unwrap()
|
|
|
+ .to_string(),
|
|
|
))?;
|
|
|
println!("{:#?}", obj.as_ref());
|
|
|
|
|
@@ -460,9 +452,9 @@ impl<O: CLIObject, IC: InterfaceCustomization> ClapInterface<O, IC> {
|
|
|
&mut self,
|
|
|
datum: &EP::Datum,
|
|
|
) {
|
|
|
- struct Discriminator<'l, D: Datum>(&'l D, &'static str);
|
|
|
+ struct Discriminator(&'static str);
|
|
|
|
|
|
- impl<'l, D: Datum> DatumDiscriminatorRef for Discriminator<'l, D> {
|
|
|
+ impl DatumDiscriminatorRef for Discriminator {
|
|
|
fn visit_serialized<
|
|
|
T: serde::Serialize + serde::de::DeserializeOwned,
|
|
|
>(
|
|
@@ -473,23 +465,23 @@ impl<O: CLIObject, IC: InterfaceCustomization> ClapInterface<O, IC> {
|
|
|
fn visit_bare_field<T: Datum>(&mut self, _: &T) {}
|
|
|
fn visit_entity_id<E: Entity>(&mut self, _: &E::ID) {}
|
|
|
fn visit_assoc_map<E: Entity>(&mut self, amap: &AssocMap<E>) {
|
|
|
- inspect_ai(self.1, amap);
|
|
|
+ inspect_ai(self.0, amap);
|
|
|
}
|
|
|
fn visit_assoc_domain<R: microrm::schema::Relation>(
|
|
|
&mut self,
|
|
|
adomain: µrm::schema::AssocDomain<R>,
|
|
|
) {
|
|
|
- inspect_ai(self.1, adomain);
|
|
|
+ inspect_ai(self.0, adomain);
|
|
|
}
|
|
|
fn visit_assoc_range<R: microrm::schema::Relation>(
|
|
|
&mut self,
|
|
|
arange: µrm::schema::AssocRange<R>,
|
|
|
) {
|
|
|
- inspect_ai(self.1, arange);
|
|
|
+ inspect_ai(self.0, arange);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- datum.accept_discriminator_ref(&mut Discriminator(datum, EP::part_name()));
|
|
|
+ datum.accept_discriminator_ref(&mut Discriminator(EP::part_name()));
|
|
|
}
|
|
|
}
|
|
|
|