Skip to content

Commit

Permalink
lib: refactoring for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
masscry committed May 2, 2024
1 parent 92e7084 commit 8833975
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/reactor/future.hh
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ private:
IntrusivePtr<State<Data>> state;
};

template<typename DataFut, typename... Args>
template<typename DataFut = void, typename... Args>
Future<DataFut> make_ready_future(Args&&... args) {
return Future<DataFut>(IntrusivePtr<State<DataFut>>(new State<DataFut>(std::forward<Args>(args)...)));
}

template<typename DataFut>
template<typename DataFut = void>
Future<DataFut> make_exception_future(std::exception_ptr exc) {
return Future<DataFut>(IntrusivePtr<State<DataFut>>(new State<DataFut>(std::move(exc))));
}
Expand Down
6 changes: 2 additions & 4 deletions lib/reactor/io/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace corey {

namespace {

Log logger("io/file");

} // namespace

Future<File> File::open(const char* path, int flags) {
Expand All @@ -26,8 +24,8 @@ Future<File> File::open(const char* path, int flags, mode_t mode) {

constexpr int invalid_fd = -1;

File::File() noexcept : File(invalid_fd) { logger.debug("File()"); }
File::File(int fd) : _fd(fd) { logger.debug("File({})", fd); }
File::File() noexcept : File(invalid_fd) { }
File::File(int fd) : _fd(fd) {}

File::File(File&& other) noexcept: _fd(other._fd) {
other._fd = invalid_fd;
Expand Down
6 changes: 4 additions & 2 deletions lib/utils/log.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public:
error = 3
};

std::string get_name() const { return name; }
Level get_level() const { return filter_level; }
const Sink<>& get_sink() const { return sink; }

Level set_level(Level);
Sink<> set_sink(Sink<>&&);

const Sink<>& get_sink() const { return sink; }

Log(std::string_view name);
Log(std::string_view, Level);
Log(std::string_view, Sink<>&&);
Expand Down

0 comments on commit 8833975

Please sign in to comment.