Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Arr alias #954

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading