瀏覽代碼

Unused did-you-mean helper

default_compile_flags
vector-of-bool 4 年之前
父節點
當前提交
218f90f9ef
共有 2 個文件被更改,包括 0 次插入17 次删除
  1. +0
    -10
      src/dds/dym.cpp
  2. +0
    -7
      src/dds/dym.hpp

+ 0
- 10
src/dds/dym.cpp 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存