Fix some warnings by cppcheck
Warning message:
sysfs.hpp:27:5: style: Class 'SysfsLed' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
SysfsLed(std::filesystem::path&& root) : root(std::move(root))
^
test/sysfs.cpp:53:5: style: Class 'FakeSysfsLed' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
FakeSysfsLed(fs::path&& path) : SysfsLed(std::move(path))
Tested: Use cppcheck to build successfully and eliminate the above
warning message.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ib6cef5cb4eb6f44f3b8dcc0e9d2b95bd15c9818a
diff --git a/sysfs.hpp b/sysfs.hpp
index fbf5e78..752bc57 100644
--- a/sysfs.hpp
+++ b/sysfs.hpp
@@ -24,7 +24,7 @@
class SysfsLed
{
public:
- SysfsLed(std::filesystem::path&& root) : root(std::move(root))
+ explicit SysfsLed(std::filesystem::path&& root) : root(std::move(root))
{}
SysfsLed() = delete;
SysfsLed(const SysfsLed& other) = delete;