Skip to content

Commit

Permalink
some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Jan 31, 2025
1 parent b9fba99 commit b6fb9fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/BuildConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ operator<<(std::ostream& os, VarType type) {

Result<BuildConfig>
BuildConfig::init(const Manifest& manifest, const bool isDebug) {
using std::string_view_literals::operator""sv;

std::string libName;
if (manifest.package.name.starts_with("lib")) {
libName = fmt::format("{}.a", manifest.package.name);
Expand Down
2 changes: 2 additions & 0 deletions src/Cmd/Add.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ getDependencyGitUrl(const std::string_view dep) {

static std::string
getDependencyName(const std::string_view dep) {
using std::string_view_literals::operator""sv;

std::string name;
if (dep.find("://") == std::string_view::npos) {
name = dep.substr(dep.find_last_of('/') + 1);
Expand Down
2 changes: 2 additions & 0 deletions src/Cmd/Test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ Test::compileTestTargets() {

Result<void>
Test::runTestTargets() {
using std::string_view_literals::operator""sv;

const auto start = std::chrono::steady_clock::now();

std::size_t numPassed = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Manifest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ static Result<std::unordered_map<std::string, Profile>>
parseProfiles(const toml::value& val) noexcept {
std::unordered_map<std::string, Profile> profiles;
const BaseProfile baseProfile = Try(parseBaseProfile(val));
profiles.insert({ "dev", Try(parseDevProfile(val, baseProfile)) });
profiles.insert({ "release", Try(parseReleaseProfile(val, baseProfile)) });
profiles.emplace("dev", Try(parseDevProfile(val, baseProfile)));
profiles.emplace("release", Try(parseReleaseProfile(val, baseProfile)));
return Ok(profiles);
}

Expand Down
1 change: 0 additions & 1 deletion src/Manifest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace cabin {

namespace fs = std::filesystem;
using std::string_view_literals::operator""sv;

struct Edition {
enum class Year : uint16_t {
Expand Down

0 comments on commit b6fb9fe

Please sign in to comment.