Skip to content

Commit 248a471

Browse files
committed
refactor: remove unused functions
1 parent 7ba15a3 commit 248a471

File tree

2 files changed

+6
-58
lines changed

2 files changed

+6
-58
lines changed

cucumber_cpp/library/Application.cpp

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ namespace cucumber_cpp::library
3939
{
4040
namespace
4141
{
42-
std::string_view const_char_to_sv(const char* value)
43-
{
44-
return { value };
45-
}
46-
47-
std::string_view subrange_to_sv(const auto& subrange)
48-
{
49-
return { std::data(subrange), std::data(subrange) + std::size(subrange) };
50-
}
51-
5242
template<class Range>
5343
std::string Join(const Range& range, std::string_view delim)
5444
{
@@ -57,26 +47,16 @@ namespace cucumber_cpp::library
5747

5848
return std::accumulate(std::next(range.begin()), range.end(), range.front(), [&delim](const auto& lhs, const auto& rhs)
5949
{
60-
std::string join;
61-
join.reserve(lhs.size() + delim.size() + rhs.size());
62-
join.append(lhs);
63-
join.append(delim);
64-
join.append(rhs);
65-
return join;
50+
return std::format("{}{}{}", lhs, delim, rhs);
6651
});
6752
}
6853

69-
std::string JoinStringWithSpace(const std::string& a, const std::string& b)
70-
{
71-
return a + ' ' + b;
72-
}
73-
74-
std::filesystem::path to_fs_path(const std::string_view& sv)
54+
std::filesystem::path ToFileSystemPath(const std::string_view& sv)
7555
{
7656
return { sv };
7757
}
7858

79-
bool is_feature_file(const std::filesystem::directory_entry& entry)
59+
bool IsFeatureFile(const std::filesystem::directory_entry& entry)
8060
{
8161
return std::filesystem::is_regular_file(entry) && entry.path().has_extension() && entry.path().extension() == ".feature";
8262
}
@@ -85,9 +65,9 @@ namespace cucumber_cpp::library
8565
{
8666
std::vector<std::filesystem::path> files;
8767

88-
for (const auto feature : options.features | std::views::transform(to_fs_path))
68+
for (const auto feature : options.features | std::views::transform(ToFileSystemPath))
8969
if (std::filesystem::is_directory(feature))
90-
for (const auto& entry : std::filesystem::directory_iterator{ feature } | std::views::filter(is_feature_file))
70+
for (const auto& entry : std::filesystem::directory_iterator{ feature } | std::views::filter(IsFeatureFile))
9171
files.emplace_back(entry.path());
9272
else
9373
files.emplace_back(feature);
@@ -107,26 +87,7 @@ namespace cucumber_cpp::library
10787
else
10888
return std::string{};
10989
})
110-
{
111-
}
112-
113-
ResultStatus& ResultStatus::operator=(Result result)
114-
{
115-
if ((resultStatus == Result::undefined || resultStatus == Result::passed) && result != Result::undefined)
116-
resultStatus = result;
117-
118-
return *this;
119-
}
120-
121-
ResultStatus::operator Result() const
122-
{
123-
return resultStatus;
124-
}
125-
126-
bool ResultStatus::IsSuccess() const
127-
{
128-
return resultStatus == Result::passed;
129-
}
90+
{}
13091

13192
Application::Application(std::shared_ptr<ContextStorageFactory> contextStorageFactory)
13293
: contextManager{ std::move(contextStorageFactory) }

cucumber_cpp/library/Application.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,6 @@ namespace cucumber_cpp::library
2525
explicit ReportHandlerValidator(const report::Reporters& reporters);
2626
};
2727

28-
struct ResultStatus
29-
{
30-
using Result = engine::Result;
31-
32-
ResultStatus& operator=(Result result);
33-
explicit operator Result() const;
34-
35-
[[nodiscard]] bool IsSuccess() const;
36-
37-
private:
38-
Result resultStatus{ Result::undefined };
39-
};
40-
4128
struct Application
4229
{
4330
struct Options

0 commit comments

Comments
 (0)