Skip to content

Commit

Permalink
Enable nullable annotations for Utf8String. (dotnet#32967)
Browse files Browse the repository at this point in the history
Clean up unnecessary things in the .csproj files.
  • Loading branch information
eerhardt authored Feb 29, 2020
1 parent cf4cc83 commit 0ae00aa
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProjectGuid>{7AF57E6B-2CED-45C9-8BCA-5BBA60D018E0}</ProjectGuid>
<!-- disable warnings about obsolete APIs -->
<NoWarn>$(NoWarn);0809;0618</NoWarn>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
<RootNamespace>System</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup Condition="'$(IsPrerelease)' != 'false'">
<Compile Include="System\IO\Utf8StringStream.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public Utf8StringContent(Utf8String content)
{
}

public Utf8StringContent(Utf8String content, string mediaType)
public Utf8StringContent(Utf8String content, string? mediaType)
{
if (content is null)
{
Expand All @@ -41,7 +41,7 @@ protected override Task<Stream> CreateContentReadStreamAsync()
return Task.FromResult<Stream>(new Utf8StringStream(_content));
}

protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)
protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context)
{
return stream.WriteAsync(_content.AsMemoryBytes()).AsTask();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<TestRuntime>true</TestRuntime>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<RootNamespace>System</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<!-- Must reference the Utf8String reference assembly, which is normally excluded from unit test projects. -->
Expand Down

0 comments on commit 0ae00aa

Please sign in to comment.