Skip to content

Commit

Permalink
Minor update to take advantage of C# 12.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLamansky committed Mar 10, 2024
1 parent a6369ed commit f96d5ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion WebAssembly.Tests/WebAssembly.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<LangVersion>12.0</LangVersion>
<RootNamespace>WebAssembly</RootNamespace>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
Expand Down
11 changes: 2 additions & 9 deletions WebAssembly/RegeneratingWeakReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

namespace WebAssembly;

readonly struct RegeneratingWeakReference<T>
readonly struct RegeneratingWeakReference<T>(Func<T> regenerator)
where T : class
{
private readonly WeakReference<T> reference;
private readonly Func<T> regenerator;

public RegeneratingWeakReference(Func<T> regenerator)
{
this.reference = new WeakReference<T>(regenerator(), false);
this.regenerator = regenerator;
}
private readonly WeakReference<T> reference = new(regenerator(), false);

public T Reference
{
Expand Down
2 changes: 1 addition & 1 deletion WebAssembly/WebAssembly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageProjectUrl>https://github.com/RyanLamansky/dotnet-webassembly</PackageProjectUrl>
<Copyright>Copyright © Ryan Lamansky. All rights reserved.</Copyright>
<PackageTags>WebAssembly WASM JIT</PackageTags>
<LangVersion>10.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<RepositoryUrl>https://github.com/RyanLamansky/dotnet-webassembly</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down

0 comments on commit f96d5ef

Please sign in to comment.