Browse Source

Unused did-you-mean helper

default_compile_flags
vector-of-bool 4 years ago
parent
commit
218f90f9ef
2 changed files with 0 additions and 17 deletions
  1. +0
    -10
      src/dds/dym.cpp
  2. +0
    -7
      src/dds/dym.hpp

+ 0
- 10
src/dds/dym.cpp View File

@@ -45,13 +45,3 @@ std::size_t dds::lev_edit_distance(std::string_view a, std::string_view b) noexc

return matrix.back().back();
}

bool lm_reject_dym::operator()(std::string_view context,
std::string_view key,
std::string_view) const {
assert(candidates.size() > 0);
throw_user_error<errc::invalid_config_key>("{}: Unknown key '{}' (Did you meann '{}'?)",
context,
key,
*did_you_mean(key, candidates));
}

+ 0
- 7
src/dds/dym.hpp View File

@@ -58,11 +58,4 @@ did_you_mean(std::string_view given, std::initializer_list<std::string_view> str
return did_you_mean(given, ranges::views::all(strings));
}

struct lm_reject_dym {
std::initializer_list<std::string_view> candidates;

[[noreturn]] bool
operator()(std::string_view context, std::string_view key, std::string_view value) const;
};

} // namespace dds

Loading…
Cancel
Save