Skip to content

Commit 0b4eeda

Browse files
RafaelJCamaraWhitWaldo
authored andcommitted
Remove unused variables (dapr#1314)
* Remove unused variables Signed-off-by: Rafael Camara <[email protected]> Signed-off-by: Rafael Câmara <[email protected]> Co-authored-by: Whit Waldo <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]>
1 parent 01eddad commit 0b4eeda

File tree

26 files changed

+94
-114
lines changed

26 files changed

+94
-114
lines changed

examples/Actor/ActorClient/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static async Task Main(string[] args)
8585
var nonRemotingProxy = ActorProxy.Create(actorId, "DemoActor");
8686
await nonRemotingProxy.InvokeMethodAsync("TestNoArgumentNoReturnType");
8787
await nonRemotingProxy.InvokeMethodAsync("SaveData", data);
88-
var res = await nonRemotingProxy.InvokeMethodAsync<MyData>("GetData");
88+
await nonRemotingProxy.InvokeMethodAsync<MyData>("GetData");
8989

9090
Console.WriteLine("Registering the timer and reminder");
9191
await proxy.RegisterTimer();

examples/AspNetCore/RoutingSample/Startup.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ await JsonSerializer.SerializeAsync(context.Response.Body,
221221

222222
async Task ViewErrorMessage(HttpContext context)
223223
{
224-
var client = context.RequestServices.GetRequiredService<DaprClient>();
225224
var transaction = await JsonSerializer.DeserializeAsync<Transaction>(context.Request.Body, serializerOptions);
226225

227226
logger.LogInformation("The amount cannot be negative: {0}", transaction.Amount);

examples/GeneratedActor/ActorClient/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
var client = new ClientActorClient(proxy);
2525

26-
var state = await client.GetStateAsync(cancellationTokenSource.Token);
26+
await client.GetStateAsync(cancellationTokenSource.Token);
2727

2828
await client.SetStateAsync(new ClientState("Hello, World!"), cancellationTokenSource.Token);
2929

examples/Workflow/WorkflowUnitTest/OrderProcessingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task TestInsufficientInventory()
6464
.Returns(Task.FromResult(inventoryResult));
6565

6666
// Run the workflow directly
67-
OrderResult result = await new OrderProcessingWorkflow().RunAsync(mockContext.Object, order);
67+
await new OrderProcessingWorkflow().RunAsync(mockContext.Object, order);
6868

6969
// Verify that ReserveInventoryActivity was called with a specific input
7070
mockContext.Verify(

src/Dapr.Actors.Generators/ActorClientGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ public void Execute(GeneratorExecutionContext context)
112112
{
113113
try
114114
{
115-
var actorInterfaceTypeName = interfaceSymbol.Name;
116115
var fullyQualifiedActorInterfaceTypeName = interfaceSymbol.ToString();
117116

118117
var attributeData = interfaceSymbol.GetAttributes().Single(a => a.AttributeClass?.Equals(generateActorClientAttributeSymbol, SymbolEqualityComparer.Default) == true);

src/Dapr.Actors/Runtime/ActorManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ internal async Task FireTimerAsync(ActorId actorId, Stream requestBodyStream, Ca
229229
// Create a Func to be invoked by common method.
230230
async Task<byte[]> RequestFunc(Actor actor, CancellationToken ct)
231231
{
232-
var actorTypeName = actor.Host.ActorTypeInfo.ActorTypeName;
233232
var actorType = actor.Host.ActorTypeInfo.ImplementationType;
234233
var methodInfo = actor.GetMethodInfoUsingReflection(actorType, timerData.Callback);
235234

@@ -241,7 +240,7 @@ async Task<byte[]> RequestFunc(Actor actor, CancellationToken ct)
241240
return default;
242241
}
243242

244-
var result = await this.DispatchInternalAsync(actorId, this.timerMethodContext, RequestFunc, cancellationToken);
243+
await this.DispatchInternalAsync(actorId, this.timerMethodContext, RequestFunc, cancellationToken);
245244
}
246245

247246
internal async Task ActivateActorAsync(ActorId actorId)

test/Dapr.Actors.AspNetCore.IntegrationTest/HostingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void MapActorsHandlers_WithoutAddActors_Throws()
4242
// NOTE: in 3.1 TestServer.CreateClient triggers the failure, in 5.0 it's Host.Start
4343
using var host = CreateHost<BadStartup>();
4444
var server = host.GetTestServer();
45-
var client = server.CreateClient();
45+
server.CreateClient();
4646
});
4747

4848
Assert.Equal(

test/Dapr.Actors.Test/ActorCodeBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ActorCodeBuilderTests
3232
[Fact]
3333
public void TestBuildActorProxyGenerator()
3434
{
35-
ActorProxyGenerator proxyGenerator = ActorCodeBuilder.GetOrCreateProxyGenerator(typeof(ITestActor));
35+
ActorCodeBuilder.GetOrCreateProxyGenerator(typeof(ITestActor));
3636
}
3737

3838
[Fact]

test/Dapr.Actors.Test/ActorIdTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ public class ActorIdTests
115115
[InlineData(" ")]
116116
public void Initialize_New_ActorId_Object_With_Null_Or_Whitespace_Id(string id)
117117
{
118-
Assert.Throws<ArgumentException>(() =>
119-
{
120-
ActorId actorId = new ActorId(id);
121-
});
118+
Assert.Throws<ArgumentException>(() => new ActorId(id));
122119
}
123120

124121
[Theory]

test/Dapr.Actors.Test/Runtime/ActorManagerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public async Task DeactivateActorAsync_ExceptionDuringDeactivation_ActorIsRemove
164164

165165
var id = ActorId.CreateRandom();
166166
await manager.ActivateActorAsync(id);
167-
Assert.True(manager.TryGetActorAsync(id, out var actor));
167+
Assert.True(manager.TryGetActorAsync(id, out _));
168168

169169
await Assert.ThrowsAsync<InvalidTimeZoneException>(async () =>
170170
{

0 commit comments

Comments
 (0)