Skip to content

Commit 54d8721

Browse files
committed
fix fmt
1 parent de854d5 commit 54d8721

File tree

1 file changed

+23
-7
lines changed
  • crates/bevy_mod_scripting_core/src

1 file changed

+23
-7
lines changed

crates/bevy_mod_scripting_core/src/error.rs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
use crate::bindings::{
2-
access_map::{DisplayCodeLocation, ReflectAccessId}, function::namespace::Namespace,
3-
pretty_print::DisplayWithWorld, script_value::ScriptValue, ReflectBaseType, ReflectReference,
2+
access_map::{DisplayCodeLocation, ReflectAccessId},
3+
function::namespace::Namespace,
4+
pretty_print::DisplayWithWorld,
5+
script_value::ScriptValue,
6+
ReflectBaseType, ReflectReference,
47
};
58
use bevy::{
69
ecs::component::ComponentId,
710
prelude::Entity,
811
reflect::{func::FunctionError, PartialReflect, Reflect},
912
};
1013
use std::{
11-
any::TypeId, borrow::Cow, fmt::{Debug, Display}, ops::Deref, str::Utf8Error, sync::Arc
14+
any::TypeId,
15+
borrow::Cow,
16+
fmt::{Debug, Display},
17+
ops::Deref,
18+
str::Utf8Error,
19+
sync::Arc,
1220
};
1321

1422
pub type ScriptResult<T> = Result<T, ScriptError>;
@@ -494,8 +502,14 @@ impl InteropError {
494502
}))
495503
}
496504

497-
pub fn unregistered_component_or_resource_type(type_name: impl Into<Cow<'static, str>>) -> Self {
498-
Self(Arc::new(InteropErrorInner::UnregisteredComponentOrResourceType { type_name: type_name.into() }))
505+
pub fn unregistered_component_or_resource_type(
506+
type_name: impl Into<Cow<'static, str>>,
507+
) -> Self {
508+
Self(Arc::new(
509+
InteropErrorInner::UnregisteredComponentOrResourceType {
510+
type_name: type_name.into(),
511+
},
512+
))
499513
}
500514

501515
pub fn inner(&self) -> &InteropErrorInner {
@@ -789,14 +803,16 @@ macro_rules! invariant {
789803

790804
macro_rules! unregistered_component_or_resource_type {
791805
($type_name:expr) => {
792-
format!("Expected registered component/resource but got unregistered type: {}", $type_name)
806+
format!(
807+
"Expected registered component/resource but got unregistered type: {}",
808+
$type_name
809+
)
793810
};
794811
}
795812

796813
impl DisplayWithWorld for InteropErrorInner {
797814
fn display_with_world(&self, world: crate::bindings::WorldGuard) -> String {
798815
match self {
799-
800816
InteropErrorInner::MissingFunctionError { on, function_name } => {
801817
missing_function_error!(function_name, on.display_with_world(world))
802818
},

0 commit comments

Comments
 (0)