Skip to content

Commit 9c49f06

Browse files
committed
fix some lints
1 parent cda1eb1 commit 9c49f06

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

libs/internal/include/launchdarkly/events/request_worker.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ enum class State {
2424
PermanentlyFailed = 4,
2525
};
2626

27-
std::ostream& operator<<(std::ostream& out, State const& s);
27+
std::ostream& operator<<(std::ostream& out, State const& state);
2828

2929
enum class Action {
3030
/* No action necessary. */
@@ -39,7 +39,7 @@ enum class Action {
3939
NotifyPermanentFailure = 4,
4040
};
4141

42-
std::ostream& operator<<(std::ostream& out, Action const& s);
42+
std::ostream& operator<<(std::ostream& out, Action const& state);
4343

4444
/**
4545
* Computes the next (state, action) pair from an existing state and an HTTP
@@ -105,7 +105,7 @@ class RequestWorker {
105105
/**
106106
* Returns true if the worker is available for delivery.
107107
*/
108-
bool Available() const;
108+
[[nodiscard]] bool Available() const;
109109

110110
/**
111111
* Passes an EventBatch to the worker for delivery. The delivery may be
@@ -136,10 +136,10 @@ class RequestWorker {
136136
<< batch_->Target() << " with payload: "
137137
<< batch_->Request().Body().value_or("(no body)");
138138

139-
requester_.Request(
140-
batch_->Request(), [this, handler](network::HttpResult result) {
141-
OnDeliveryAttempt(std::move(result), std::move(handler));
142-
});
139+
requester_.Request(batch_->Request(),
140+
[this, handler](network::HttpResult const& result) {
141+
OnDeliveryAttempt(result, std::move(handler));
142+
});
143143
return result.get();
144144
}
145145

@@ -170,7 +170,8 @@ class RequestWorker {
170170

171171
Logger& logger_;
172172

173-
void OnDeliveryAttempt(network::HttpResult request, ResultCallback cb);
173+
void OnDeliveryAttempt(network::HttpResult const& request,
174+
ResultCallback cb);
174175
};
175176

176177
} // namespace launchdarkly::events

libs/internal/src/events/request_worker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RequestWorker::RequestWorker(boost::asio::any_io_executor io,
88
std::size_t id,
99
std::optional<std::locale> date_header_locale,
1010
Logger& logger)
11-
: timer_(io),
11+
: timer_(std::move(io)),
1212
retry_delay_(retry_after),
1313
state_(State::Idle),
1414
requester_(timer_.get_executor()),
@@ -49,7 +49,7 @@ static bool IsSuccess(network::HttpResult const& result) {
4949
http::status_class::successful;
5050
}
5151

52-
void RequestWorker::OnDeliveryAttempt(network::HttpResult result,
52+
void RequestWorker::OnDeliveryAttempt(network::HttpResult const& result,
5353
ResultCallback callback) {
5454
auto [next_state, action] = NextState(state_, result);
5555

0 commit comments

Comments
 (0)