Skip to content

Commit

Permalink
maint: Remove some warnings (#3320)
Browse files Browse the repository at this point in the history
* maint: Remove some warnings

Signed-off-by: Julien Jerphanion <[email protected]>

* Lint

Signed-off-by: Julien Jerphanion <[email protected]>

---------

Signed-off-by: Julien Jerphanion <[email protected]>
  • Loading branch information
jjerphan authored Jun 13, 2024
1 parent 0793fad commit d12f371
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libmamba/src/api/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,11 @@ namespace mamba
// creating ``.pyc`` files.
// Ideally this whole function should be properly refactored and the transaction itself
// should not need the database.
auto trans = [&](auto db)
auto trans = [&](auto database)
{
return MTransaction( //
ctx,
db,
database,
request,
std::get<solver::Solution>(outcome),
package_caches
Expand Down
7 changes: 5 additions & 2 deletions libmamba/src/api/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,18 @@ namespace mamba
std::cout << activator->deactivate();
}

#ifdef _WIN32
void shell_enable_long_path_support(Palette palette)
{
#ifdef _WIN32
if (const bool success = enable_long_paths_support(/* force= */ true, palette); !success)
{
throw std::runtime_error("Error enabling Windows long-path support");
}
}
#else
void shell_enable_long_path_support(Palette)
{
throw std::invalid_argument("Long path support is a Windows only option");
#endif
}
#endif
}
3 changes: 1 addition & 2 deletions libmamba/src/core/activation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,7 @@ namespace mamba
return "";
}

std::pair<std::string, std::string>
NuActivator::update_prompt(const std::string& conda_prompt_modifier)
std::pair<std::string, std::string> NuActivator::update_prompt(const std::string&)
{
// hook is implemented in shell_init.cpp as nushell behaves like a compiled language;
// one cannot dynamically evaluate strings
Expand Down
4 changes: 2 additions & 2 deletions libmamba/src/core/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ namespace mamba
*/
auto print_other_builds(
std::ostream& out,
const specs::PackageInfo& pkg,
const specs::PackageInfo&,
const std::map<std::string, std::vector<specs::PackageInfo>> groupedOtherBuilds,
bool showAllBuilds
)
Expand Down Expand Up @@ -860,7 +860,7 @@ namespace mamba
auto QueryResult::json() const -> nlohmann::json
{
nlohmann::json j;
std::string query_type = std::string(util::to_lower(enum_name(m_type)));
std::string query_type = util::to_lower(enum_name(m_type));
j["query"] = { { "query", m_query }, { "type", query_type } };

std::string msg = m_pkg_id_list.empty() ? "No entries matching \"" + m_query + "\" found"
Expand Down
1 change: 1 addition & 0 deletions libmamba/tests/src/solver/test_problems_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ TEST_CASE("Create problem graph")
std::pair{ "PubGrub example", &create_pubgrub },
std::pair{ "Harder PubGrub example", &create_pubgrub_hard },
std::pair{ "PubGrub example with missing packages", &create_pubgrub_missing },
std::pair{ "Pin conflict", &create_pin_conflict },
std::pair{ "PyTorch CPU", &create_pytorch_cpu },
std::pair{ "PyTorch Cuda", &create_pytorch_cuda },
std::pair{ "Cuda Toolkit", &create_cudatoolkit },
Expand Down

0 comments on commit d12f371

Please sign in to comment.