File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
crates/bevy_mod_scripting_core/src Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ impl AssetLoader for ScriptAssetLoader {
4747 reader
4848 . read_to_end ( & mut content)
4949 . await
50- . map_err ( |e| ScriptError :: new_error ( e) . with_context ( load_context. asset_path ( ) ) ) ?;
50+ . map_err ( |e| ScriptError :: new_external ( e) . with_context ( load_context. asset_path ( ) ) ) ?;
5151 if let Some ( processor) = & self . preprocessor {
5252 processor ( & mut content) ?;
5353 }
Original file line number Diff line number Diff line change @@ -235,8 +235,7 @@ impl<I: Iterator<Item = ScriptValue>> IntoArgsListWithAccess for I {
235235 function_info,
236236 Some ( argument_info) ,
237237 InteropError :: impossible_conversion ( argument_info. type_id ( ) ) ,
238- )
239- . into ( ) ) ;
238+ ) ) ;
240239 }
241240 } ;
242241
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ impl ScriptError {
111111 match error {
112112 mlua:: Error :: ExternalError ( inner) => {
113113 if let Some ( script_error) = inner. downcast_ref :: < InteropError > ( ) {
114- Self :: new ( script_error. clone ( ) )
114+ script_error. clone ( ) . into ( )
115115 } else {
116116 Self :: new_external ( inner)
117117 }
@@ -218,6 +218,12 @@ impl DisplayWithWorld for InteropError {
218218
219219impl_dummy_display ! ( InteropError ) ;
220220
221+ impl From < InteropError > for ScriptError {
222+ fn from ( val : InteropError ) -> Self {
223+ ScriptError :: new ( val)
224+ }
225+ }
226+
221227impl InteropError {
222228 pub fn missing_world ( ) -> Self {
223229 Self ( Arc :: new ( InteropErrorInner :: MissingWorld ) )
You can’t perform that action at this time.
0 commit comments