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

Rename aliases to common #1047

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/Algos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ findSimilarStr(

#ifdef POAC_TEST

# include "Rustify/Aliases.hpp"
# include "Rustify/Common.hpp"
# include "Rustify/Tests.hpp"

# include <array>
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "Logger.hpp"
#include "Rustify/Aliases.hpp"
#include "Rustify/Common.hpp"

#include <cstdlib>
#include <functional>
Expand Down
2 changes: 1 addition & 1 deletion src/Manifest.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "Rustify/Aliases.hpp"
#include "Rustify/Common.hpp"
#include "Semver.hpp"

#include <compare>
Expand Down
2 changes: 1 addition & 1 deletion src/Rustify.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#include "Rustify/Aliases.hpp"
#include "Rustify/Common.hpp"
#include "Rustify/Tests.hpp"
#include "Rustify/Traits.hpp"
9 changes: 4 additions & 5 deletions src/Rustify/Aliases.hpp → src/Rustify/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <cstddef>
#include <filesystem>
#include <fmt/format.h>
#include <source_location>
#include <sstream>
#include <stdexcept>
#include <string_view>

Expand All @@ -24,10 +24,9 @@ panic(
const std::string_view msg,
const std::source_location& loc = std::source_location::current()
) {
std::ostringstream oss;
oss << "panicked at '" << msg << "', " << loc.file_name() << ':' << loc.line()
<< '\n';
throw std::logic_error(oss.str());
throw std::logic_error(
fmt::format("panicked at '{}', {}:{}\n", msg, loc.file_name(), loc.line())
);
}

[[noreturn]] inline void
Expand Down
2 changes: 1 addition & 1 deletion src/VersionReq.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "VersionReq.hpp"

#include "Exception.hpp"
#include "Rustify/Aliases.hpp"
#include "Rustify/Common.hpp"

#include <cctype>
#include <cstddef>
Expand Down