Skip to content

Commit

Permalink
Address clang-tidy feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jeaye committed Dec 10, 2024
1 parent c6348e8 commit aeed354
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ misc-definitions-in-headers,\
-cppcoreguidelines-rvalue-reference-param-not-moved,\
-bugprone-easily-swappable-parameters,\
-bugprone-reserved-identifier,\
-bugprone-multi-level-implicit-pointer-conversion,\
-readability-redundant-member-init,\
-readability-implicit-bool-conversion,\
-readability-magic-numbers,\
Expand Down
3 changes: 2 additions & 1 deletion compiler+runtime/include/cpp/jank/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ extern "C"
void jank_set_meta(jank_object_ptr o, jank_object_ptr meta);

void jank_throw(jank_object_ptr o);
jank_object_ptr jank_try(jank_object_ptr body, jank_object_ptr catch_, jank_object_ptr finally);
jank_object_ptr
jank_try(jank_object_ptr try_fn, jank_object_ptr catch_fn, jank_object_ptr finally_fn);

void jank_profile_enter(char const *label);
void jank_profile_exit(char const *label);
Expand Down
5 changes: 3 additions & 2 deletions compiler+runtime/include/cpp/jank/option.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace jank
template <typename T>
struct option
{
/* NOLINTNEXTLINE(bugprone-sizeof-expression): Safe to do this. */
using storage_type = char[sizeof(T)];
using value_type = T;

Expand Down Expand Up @@ -203,7 +204,7 @@ namespace jank
}

template <typename F>
constexpr auto map(F &&f) const -> option<decltype(f(std::declval<T>()))>
constexpr auto map(F const &f) const -> option<decltype(f(std::declval<T>()))>
{
if(set)
{
Expand All @@ -213,7 +214,7 @@ namespace jank
}

template <typename F>
constexpr T map_or(T fallback, F &&f) const
constexpr T map_or(T fallback, F const &f) const
{
if(set)
{
Expand Down

0 comments on commit aeed354

Please sign in to comment.