etr/libhttpserver

[BUG] use of const shared_ptr return type is ineffective/unneeded

stuart-byma opened this issue · 1 comments

Prerequisites

Description

This is a sort-of bug and really a minor issue.

Using const qualifier on the shared_ptr return type is ineffective and unneeded. clang-tidy points out:

warning: return type 'const std::shared_ptrhttpserver::http_response' is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type]
std::shared_ptrhttpserver::http_response const

See https://stackoverflow.com/questions/63972019/understanding-const-at-top-level-which-may-reduce-code-readability-without-i

for more details.

Steps to Reproduce

To reproduce, run clang-tidy 14 or 15 on the code base, or any code that uses a const std::shared_ptr<http_response> return type.

Expected behavior: [What you expect to happen]

No issues found (at least not this one, there maybe other things that clang-tidy flags).

Actual behavior: [What actually happens]

clang-tidy reports the issue.

Reproduces how often: [What percentage of the time does it reproduce?]
100%

Versions

clang-tidy 14 or 15, possibly earlier versions as well.

Additional Information

None

etr commented

It does make sense - I just approved the PR. Thanks a lot for your help.