Skip to content

Commit 8ea87b5

Browse files
committed
refactor: update return type of LoadAsync in ILuaFileLoader
1 parent 65a18e8 commit 8ea87b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Lua/IO/CompositeLoaderFileSystem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async ValueTask<ILuaStream> Open(string path, LuaFileMode mode, Cancellat
5151
{
5252
if (mode.CanWrite())
5353
throw new NotSupportedException("Cannot write to a file opened with a loader.");
54-
return ILuaStream.CreateFromFileContent(await loaders[cachedValue.index].LoadAsync(path, cancellationToken));
54+
return (await loaders[cachedValue.index].LoadAsync(path, cancellationToken));
5555
}
5656
}
5757
}
@@ -63,7 +63,7 @@ public async ValueTask<ILuaStream> Open(string path, LuaFileMode mode, Cancellat
6363
{
6464
if (mode.CanWrite())
6565
throw new NotSupportedException("Cannot write to a file opened with a loader.");
66-
return ILuaStream.CreateFromFileContent(await loader.LoadAsync(path, cancellationToken));
66+
return (await loader.LoadAsync(path, cancellationToken));
6767
}
6868
}
6969
}

src/Lua/IO/ILuaFileLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
public interface ILuaFileLoader
44
{
55
public bool Exists(string path);
6-
public ValueTask<LuaFileContent> LoadAsync(string path, CancellationToken cancellationToken = default);
6+
public ValueTask<ILuaStream> LoadAsync(string path, CancellationToken cancellationToken = default);
77
}

0 commit comments

Comments
 (0)