Skip to content

Commit 101d85a

Browse files
committed
clang-format
1 parent 1b2fd59 commit 101d85a

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

src/datadog/span.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ void Span::remove_tag(StringView name) {
9999
}
100100
}
101101

102-
void Span::set_service_name(StringView service) { assign(data_->service, service); }
102+
void Span::set_service_name(StringView service) {
103+
assign(data_->service, service);
104+
}
103105

104-
void Span::set_service_type(StringView type) { assign(data_->service_type, type); }
106+
void Span::set_service_type(StringView type) {
107+
assign(data_->service_type, type);
108+
}
105109

106110
void Span::set_resource_name(StringView resource) {
107111
assign(data_->resource, resource);

src/datadog/string_view.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ using StringView = std::string_view;
4848
// `operator+=(string&, StringView)` isn't defined. To work around this, use
4949
// `append` everywhere.
5050
inline void append(std::string& destination, StringView text) {
51-
destination.append(text.data(), text.size());
51+
destination.append(text.data(), text.size());
5252
}
5353

5454
// When `StringView` is not the same as `std::string_view`,
5555
// `operator=(string&, StringView)` isn't defined. To work around this, use
5656
// `assign` everywhere.
5757
inline void assign(std::string& destination, StringView text) {
58-
destination.assign(text.data(), text.size());
58+
destination.assign(text.data(), text.size());
5959
}
6060

6161
} // namespace tracing

src/datadog/tracer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ Span Tracer::create_span(const SpanConfig& config) {
287287
const auto span_data_ptr = span_data.get();
288288
const auto segment = std::make_shared<TraceSegment>(
289289
logger_, collector_, trace_sampler_, span_sampler_, defaults_,
290-
injection_styles_, hostname_, nullopt /* origin */,
291-
tags_header_max_size_,
290+
injection_styles_, hostname_, nullopt /* origin */, tags_header_max_size_,
292291
std::unordered_map<std::string, std::string>{} /* trace_tags */,
293292
nullopt /* sampling_decision */, std::move(span_data));
294293
Span span{span_data_ptr, segment, generator_, clock_};

test/span.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ TEST_CASE(".error() and .set_error*()") {
234234
};
235235

236236
auto test_case = GENERATE(values<TestCase>(
237-
{{"No error → no error.", [](Span&) {}, false, nullopt, nullopt,
238-
nullopt},
237+
{{"No error → no error.", [](Span&) {}, false, nullopt, nullopt, nullopt},
239238
{"set_error(true) → error", [](Span& span) { span.set_error(true); },
240239
true, nullopt, nullopt, nullopt},
241240
{"set_error_message → error and error message",

test/tracer_config.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ TEST_CASE("TracerConfig::defaults") {
213213
"baz:123 bam:three",
214214
{{"baz", "123"}, {"bam", "three"}},
215215
nullopt},
216-
{"last one wins",
217-
"baz:123 baz:three",
218-
{{"baz", "three"}},
219-
nullopt},
216+
{"last one wins", "baz:123 baz:three", {{"baz", "three"}}, nullopt},
220217
}));
221218

222219
// This will be overriden by the DD_TAGS environment variable.
@@ -425,16 +422,15 @@ TEST_CASE("TracerConfig::agent") {
425422
auto test_case = GENERATE(values<TestCase>({
426423
{"http://dd-agent:8126", nullopt, "http", "dd-agent:8126", ""},
427424
{"http://dd-agent:8126/", nullopt, "http", "dd-agent:8126", "/"},
428-
{"https://dd-agent:8126/", nullopt, "https", "dd-agent:8126",
429-
"/"},
425+
{"https://dd-agent:8126/", nullopt, "https", "dd-agent:8126", "/"},
430426
{"unix:///var/run/datadog/trace-agent.sock", nullopt, "unix",
431427
"/var/run/datadog/trace-agent.sock"},
432428
{"unix://var/run/datadog/trace-agent.sock",
433429
Error::URL_UNIX_DOMAIN_SOCKET_PATH_NOT_ABSOLUTE},
434-
{"http+unix:///run/datadog/trace-agent.sock", nullopt,
435-
"http+unix", "/run/datadog/trace-agent.sock"},
436-
{"https+unix:///run/datadog/trace-agent.sock", nullopt,
437-
"https+unix", "/run/datadog/trace-agent.sock"},
430+
{"http+unix:///run/datadog/trace-agent.sock", nullopt, "http+unix",
431+
"/run/datadog/trace-agent.sock"},
432+
{"https+unix:///run/datadog/trace-agent.sock", nullopt, "https+unix",
433+
"/run/datadog/trace-agent.sock"},
438434
{"tcp://localhost:8126", Error::URL_UNSUPPORTED_SCHEME},
439435
{"/var/run/datadog/trace-agent.sock", Error::URL_MISSING_SEPARATOR},
440436
}));

0 commit comments

Comments
 (0)