fix: sonarcloud warnings (#2804)

* fix: break will never be executed

* refactor: compile the name fallback string

* fix: replace redundant type with auto

* fix: use init-statement to reduce variable scope

* fix: implicit conversion loses precision

* fix: use in-class initializer

* fix: make variable a pointer-to-const

* fix: local variable name shadows class variable

* fix: implicit conversion may lose precision
This commit is contained in:
Charles Kerr
2022-03-24 00:18:41 -05:00
committed by GitHub
parent 6db3fbfe64
commit b8c3778cf4
9 changed files with 26 additions and 28 deletions

View File

@@ -186,11 +186,9 @@ static std::optional<std::string> getErrorString(tr_stat const* st)
{
case TR_STAT_TRACKER_WARNING:
return fmt::format(_("Tracker warning: '{warning}'"), fmt::arg("warning", st->errorString));
break;
case TR_STAT_TRACKER_ERROR:
return fmt::format(_("Tracker Error: '{error}'"), fmt::arg("error", st->errorString));
break;
case TR_STAT_LOCAL_ERROR:
return fmt::format(_("Local error: '{error}'"), fmt::arg("error", st->errorString));