Improve reify! syntax.
This commit is contained in:
@@ -307,7 +307,7 @@ impl<'a> NativeCallContext<'a> {
|
||||
.and_then(|result| {
|
||||
// Bail out early if the return type needs no cast
|
||||
if TypeId::of::<T>() == TypeId::of::<Dynamic>() {
|
||||
return Ok(reify!(result => T));
|
||||
return Ok(reify! { result => T });
|
||||
}
|
||||
|
||||
let typ = self.engine().map_type_name(result.type_name());
|
||||
@@ -338,7 +338,7 @@ impl<'a> NativeCallContext<'a> {
|
||||
.and_then(|result| {
|
||||
// Bail out early if the return type needs no cast
|
||||
if TypeId::of::<T>() == TypeId::of::<Dynamic>() {
|
||||
return Ok(reify!(result => T));
|
||||
return Ok(reify! { result => T });
|
||||
}
|
||||
|
||||
let typ = self.engine().map_type_name(result.type_name());
|
||||
|
@@ -58,7 +58,7 @@ pub fn by_value<T: Variant + Clone>(data: &mut Dynamic) -> T {
|
||||
}
|
||||
if TypeId::of::<T>() == TypeId::of::<String>() {
|
||||
// If T is `String`, data must be `ImmutableString`, so map directly to it
|
||||
return reify!(mem::take(data).into_string().expect("`ImmutableString`") => T);
|
||||
return reify! { mem::take(data).into_string().expect("`ImmutableString`") => T };
|
||||
}
|
||||
|
||||
// We consume the argument and then replace it with () - the argument is not supposed to be used again.
|
||||
|
Reference in New Issue
Block a user