From 9086231f3923c0df6d9ef817441bfae5e134e8ff Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Mon, 10 Jan 2022 12:07:03 +0100 Subject: Converted use of _format UDL to fmt::format --- zenserver/testing/httptest.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'zenserver/testing/httptest.cpp') diff --git a/zenserver/testing/httptest.cpp b/zenserver/testing/httptest.cpp index 924546762..eedf06661 100644 --- a/zenserver/testing/httptest.cpp +++ b/zenserver/testing/httptest.cpp @@ -8,8 +8,6 @@ namespace zen { -using namespace fmt::literals; - HttpTestingService::HttpTestingService() { m_Router.RegisterRoute( @@ -25,7 +23,7 @@ HttpTestingService::HttpTestingService() Sleep(1000); Request.WriteResponse(HttpResponseCode::OK, HttpContentType::kText, - "hello, took me {}"_format(NiceTimeSpanMs(Timer.GetElapsedTimeMs()))); + fmt::format("hello, took me {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs()))); }); }, HttpVerb::kGet); @@ -38,7 +36,7 @@ HttpTestingService::HttpTestingService() Sleep(60000); Request.WriteResponse(HttpResponseCode::OK, HttpContentType::kText, - "hello, took me {}"_format(NiceTimeSpanMs(Timer.GetElapsedTimeMs()))); + fmt::format("hello, took me {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs()))); }); }, HttpVerb::kGet); -- cgit v1.2.3 From 0d80759883b95f25ab4b6714203ff6178c7f1b5a Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Mon, 10 Jan 2022 12:20:27 +0100 Subject: Unused lambda capture compile fixes --- zenserver/testing/httptest.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'zenserver/testing/httptest.cpp') diff --git a/zenserver/testing/httptest.cpp b/zenserver/testing/httptest.cpp index eedf06661..230d5d6c5 100644 --- a/zenserver/testing/httptest.cpp +++ b/zenserver/testing/httptest.cpp @@ -12,13 +12,13 @@ HttpTestingService::HttpTestingService() { m_Router.RegisterRoute( "hello", - [this](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponse(HttpResponseCode::OK); }, + [](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponse(HttpResponseCode::OK); }, HttpVerb::kGet); m_Router.RegisterRoute( "hello_slow", - [this](HttpRouterRequest& Req) { - Req.ServerRequest().WriteResponseAsync([this](HttpServerRequest& Request) { + [](HttpRouterRequest& Req) { + Req.ServerRequest().WriteResponseAsync([](HttpServerRequest& Request) { Stopwatch Timer; Sleep(1000); Request.WriteResponse(HttpResponseCode::OK, @@ -30,8 +30,8 @@ HttpTestingService::HttpTestingService() m_Router.RegisterRoute( "hello_veryslow", - [this](HttpRouterRequest& Req) { - Req.ServerRequest().WriteResponseAsync([this](HttpServerRequest& Request) { + [](HttpRouterRequest& Req) { + Req.ServerRequest().WriteResponseAsync([](HttpServerRequest& Request) { Stopwatch Timer; Sleep(60000); Request.WriteResponse(HttpResponseCode::OK, @@ -43,14 +43,14 @@ HttpTestingService::HttpTestingService() m_Router.RegisterRoute( "hello_throw", - [this](HttpRouterRequest& Req) { - Req.ServerRequest().WriteResponseAsync([this](HttpServerRequest&) { throw std::runtime_error("intentional error"); }); + [](HttpRouterRequest& Req) { + Req.ServerRequest().WriteResponseAsync([](HttpServerRequest&) { throw std::runtime_error("intentional error"); }); }, HttpVerb::kGet); m_Router.RegisterRoute( "hello_noresponse", - [this](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponseAsync([this](HttpServerRequest&) {}); }, + [](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponseAsync([](HttpServerRequest&) {}); }, HttpVerb::kGet); m_Router.RegisterRoute( @@ -82,7 +82,7 @@ HttpTestingService::HttpTestingService() m_Router.RegisterRoute( "echo", - [this](HttpRouterRequest& Req) { + [](HttpRouterRequest& Req) { IoBuffer Body = Req.ServerRequest().ReadPayload(); Req.ServerRequest().WriteResponse(HttpResponseCode::OK, HttpContentType::kBinary, Body); }, @@ -90,7 +90,7 @@ HttpTestingService::HttpTestingService() m_Router.RegisterRoute( "package", - [this](HttpRouterRequest& Req) { + [](HttpRouterRequest& Req) { CbPackage Pkg = Req.ServerRequest().ReadPayloadPackage(); Req.ServerRequest().WriteResponse(HttpResponseCode::OK, Pkg); }, -- cgit v1.2.3