Skip to content

Commit

Permalink
Remove Arr alias (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui authored Jul 21, 2024
1 parent 408f039 commit 5c40d6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/Algos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ findSimilarStr(

#ifdef POAC_TEST

# include <array>
# include <limits>

namespace tests {
Expand Down Expand Up @@ -226,9 +227,9 @@ testLevDistance2() {

void
testFindSimilarStr() {
constexpr Arr<std::string_view, 8> candidates{ "if", "ifdef", "ifndef",
"elif", "else", "endif",
"elifdef", "elifndef" };
constexpr std::array<std::string_view, 8> candidates{
"if", "ifdef", "ifndef", "elif", "else", "endif", "elifdef", "elifndef"
};

assertEq(findSimilarStr("id", candidates), "if"sv);
assertEq(findSimilarStr("ifd", candidates), "if"sv);
Expand All @@ -250,11 +251,11 @@ testFindSimilarStr() {

void
testFindSimilarStr2() {
constexpr Arr<std::string_view, 2> candidates{ "aaab", "aaabc" };
constexpr std::array<std::string_view, 2> candidates{ "aaab", "aaabc" };
assertEq(findSimilarStr("aaaa", candidates), "aaab"sv);
assertEq(findSimilarStr("1111111111", candidates), None);

constexpr Arr<std::string_view, 1> candidateS2{ "AAAA" };
constexpr std::array<std::string_view, 1> candidateS2{ "AAAA" };
assertEq(findSimilarStr("aaaa", candidateS2), "AAAA"sv);

pass();
Expand Down
3 changes: 0 additions & 3 deletions src/Rustify/Aliases.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <array>
#include <cstdint>
#include <cstdlib>
#include <filesystem>
Expand Down Expand Up @@ -33,8 +32,6 @@ using f32 = float;
using f64 = double;
// NOLINTEND(readability-identifier-naming)

template <typename T, usize N>
using Arr = std::array<T, N>;
template <typename T>
using Vec = std::vector<T>;

Expand Down

0 comments on commit 5c40d6b

Please sign in to comment.