Fix tests on systems with a non-master git defaultBranch #1

Open
zebreus wants to merge 140 commits from fix-tests-without-master into main
2 changed files with 25 additions and 0 deletions
Showing only changes of commit 92eccfbd68 - Show all commits

View file

@ -105,6 +105,7 @@ libutil_headers = files(
'regex-combinators.hh', 'regex-combinators.hh',
'regex.hh', 'regex.hh',
'repair-flag.hh', 'repair-flag.hh',
'result.hh',
'serialise.hh', 'serialise.hh',
'shlex.hh', 'shlex.hh',
'signals.hh', 'signals.hh',

24
src/libutil/result.hh Normal file
View file

@ -0,0 +1,24 @@
#pragma once
/// @file
#include <boost/outcome/std_outcome.hpp>
#include <boost/outcome/std_result.hpp>
#include <boost/outcome/success_failure.hpp>
#include <exception>
namespace nix {
template<typename T, typename E = std::exception_ptr>
using Result = boost::outcome_v2::std_result<T, E>;
template<typename T, typename D, typename E = std::exception_ptr>
using Outcome = boost::outcome_v2::std_outcome<T, D, E>;
namespace result {
using boost::outcome_v2::success;
using boost::outcome_v2::failure;
}
}