Skip to content

Commit

Permalink
Switch SubscribeAsync/UnsubscribeAsync to IEnumerable<string> (#2026)
Browse files Browse the repository at this point in the history
The function currently requires an ICollection<string>, but doesn't actually depend on the ICollection<string> interface.  Relax the requirement to be IEnumerable<string> for better flexibility.
  • Loading branch information
drelidan7 authored Jun 22, 2024
1 parent c5f4cf1 commit b95d352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public interface IManagedMqttClient : IDisposable

Task StopAsync(bool cleanDisconnect = true);

Task SubscribeAsync(ICollection<MqttTopicFilter> topicFilters);
Task SubscribeAsync(IEnumerable<MqttTopicFilter> topicFilters);

Task UnsubscribeAsync(ICollection<string> topics);
Task UnsubscribeAsync(IEnumerable<string> topics);
}
}
4 changes: 2 additions & 2 deletions Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public async Task StopAsync(bool cleanDisconnect = true)
}
}

public Task SubscribeAsync(ICollection<MqttTopicFilter> topicFilters)
public Task SubscribeAsync(IEnumerable<MqttTopicFilter> topicFilters)
{
ThrowIfDisposed();

Expand Down Expand Up @@ -316,7 +316,7 @@ public Task SubscribeAsync(ICollection<MqttTopicFilter> topicFilters)
return CompletedTask.Instance;
}

public Task UnsubscribeAsync(ICollection<string> topics)
public Task UnsubscribeAsync(IEnumerable<string> topics)
{
ThrowIfDisposed();

Expand Down

0 comments on commit b95d352

Please sign in to comment.