From 331024a1996763207fc7e70c791d3164d9bfc573 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 11 Nov 2021 07:45:46 +0100 Subject: [PATCH] refactor: simplified formatting of `latitude` and `longitude` --- example/glide_computer/include/geographic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/glide_computer/include/geographic.h b/example/glide_computer/include/geographic.h index 731425e3..5deb1b1c 100644 --- a/example/glide_computer/include/geographic.h +++ b/example/glide_computer/include/geographic.h @@ -105,7 +105,7 @@ struct STD_FMT::formatter : formatter auto format(geographic::latitude lat, FormatContext& ctx) { - STD_FMT::vformat_to(ctx.out(), lat.value() > 0 ? "N" : "S", {}); + STD_FMT::format_to(ctx.out(), "{}", lat.value() > 0 ? 'N' : 'S'); return formatter::format(lat.value() > 0 ? lat.value() : -lat.value(), ctx); } }; @@ -115,7 +115,7 @@ struct STD_FMT::formatter : formatter auto format(geographic::longitude lon, FormatContext& ctx) { - STD_FMT::vformat_to(ctx.out(), lon.value() > 0 ? "E" : "W", {}); + STD_FMT::format_to(ctx.out(), "{}", lon.value() > 0 ? 'E' : 'W'); return formatter::format(lon.value() > 0 ? lon.value() : -lon.value(), ctx); } };