about summary refs log tree commit diff
path: root/third_party/nix/src/nix-daemon
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T21·02+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T21·02+0100
commit88f337588c9f1a41ac67b3afb8d43f124b4d153b (patch)
tree1e7ee739c979f5a54a1c23fcb1a6adf49652a7e5 /third_party/nix/src/nix-daemon
parent39087321811e81e26a1a47d6967df1088dcf0e95 (diff)
refactor(3p/nix): Make all single-argument constructors explicit r/778
Implicit constructors can be confusing, especially in a codebase that
is already as unintentionally obfuscated as this one.

https://google.github.io/styleguide/cppguide.html#Explicit_Constructors
Diffstat (limited to 'third_party/nix/src/nix-daemon')
-rw-r--r--third_party/nix/src/nix-daemon/nix-daemon.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/nix/src/nix-daemon/nix-daemon.cc b/third_party/nix/src/nix-daemon/nix-daemon.cc
index 4f71a0c36fe2..0e5d7ac8baa6 100644
--- a/third_party/nix/src/nix-daemon/nix-daemon.cc
+++ b/third_party/nix/src/nix-daemon/nix-daemon.cc
@@ -74,7 +74,7 @@ struct TunnelLogger {
 
   unsigned int clientVersion;
 
-  TunnelLogger(unsigned int clientVersion) : clientVersion(clientVersion) {}
+  explicit TunnelLogger(unsigned int clientVersion) : clientVersion(clientVersion) {}
 
   void enqueueMsg(const std::string& s) {
     auto state(state_.lock());
@@ -150,7 +150,7 @@ struct TunnelLogger {
 
 struct TunnelSink : Sink {
   Sink& to;
-  TunnelSink(Sink& to) : to(to) {}
+  explicit TunnelSink(Sink& to) : to(to) {}
   virtual void operator()(const unsigned char* data, size_t len) {
     to << STDERR_WRITE;
     writeString(data, len, to);
@@ -159,7 +159,7 @@ struct TunnelSink : Sink {
 
 struct TunnelSource : BufferedSource {
   Source& from;
-  TunnelSource(Source& from) : from(from) {}
+  explicit TunnelSource(Source& from) : from(from) {}
 
  protected:
   size_t readUnbuffered(unsigned char* data, size_t len) override {