Browse Source

refactor: update return type of LoadAsync in ILuaFileLoader

Akeit0 6 months ago
parent
commit
8ea87b5bb5
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/Lua/IO/CompositeLoaderFileSystem.cs
  2. 1 1
      src/Lua/IO/ILuaFileLoader.cs

+ 2 - 2
src/Lua/IO/CompositeLoaderFileSystem.cs

@@ -51,7 +51,7 @@ public class CompositeLoaderFileSystem(ILuaFileLoader[] loaders, ILuaFileSystem?
                 {
                     if (mode.CanWrite())
                         throw new NotSupportedException("Cannot write to a file opened with a loader.");
-                    return ILuaStream.CreateFromFileContent(await loaders[cachedValue.index].LoadAsync(path, cancellationToken));
+                    return (await loaders[cachedValue.index].LoadAsync(path, cancellationToken));
                 }
             }
         }
@@ -63,7 +63,7 @@ public class CompositeLoaderFileSystem(ILuaFileLoader[] loaders, ILuaFileSystem?
                 {
                     if (mode.CanWrite())
                         throw new NotSupportedException("Cannot write to a file opened with a loader.");
-                    return ILuaStream.CreateFromFileContent(await loader.LoadAsync(path, cancellationToken));
+                    return (await loader.LoadAsync(path, cancellationToken));
                 }
             }
         }

+ 1 - 1
src/Lua/IO/ILuaFileLoader.cs

@@ -3,5 +3,5 @@
 public interface ILuaFileLoader
 {
     public bool Exists(string path);
-    public ValueTask<LuaFileContent> LoadAsync(string path, CancellationToken cancellationToken = default);
+    public ValueTask<ILuaStream> LoadAsync(string path, CancellationToken cancellationToken = default);
 }