Some more lints

This commit is contained in:
Dennis Schwerdel 2016-08-29 13:12:50 +02:00
parent d1b75e130a
commit 6502da3816
3 changed files with 7 additions and 6 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ deb/vpncloud/vpncloud
deb/vpncloud/vpncloud.1* deb/vpncloud/vpncloud.1*
Stats.ods Stats.ods
.sodium-build .sodium-build
wiki

View File

@ -27,9 +27,9 @@ impl fmt::Display for ParseError {
ParseError::Read(ref err) => write!(formatter, "Failed to read config: {}", err), ParseError::Read(ref err) => write!(formatter, "Failed to read config: {}", err),
ParseError::Syntax(ref err) => write!(formatter, "Invalid config syntax: {}", err), ParseError::Syntax(ref err) => write!(formatter, "Invalid config syntax: {}", err),
ParseError::NoDocument => write!(formatter, "Config was empty"), ParseError::NoDocument => write!(formatter, "Config was empty"),
ParseError::InvalidType(ref exp, ref value) => write!(formatter, "Invalid value encountered for type {}: {:?}", exp, value), ParseError::InvalidType(exp, ref value) => write!(formatter, "Invalid value encountered for type {}: {:?}", exp, value),
ParseError::InvalidOption(ref opt, ref opts) => write!(formatter, "Invalid option value {}, choices were {:?}", opt, opts), ParseError::InvalidOption(ref opt, ref opts) => write!(formatter, "Invalid option value {}, choices were {:?}", opt, opts),
ParseError::Unsupported(ref reason) => write!(formatter, "Failed to decode config: {}", reason), ParseError::Unsupported(reason) => write!(formatter, "Failed to decode config: {}", reason),
ParseError::Other(ref reason) => write!(formatter, "Failed to decode config: {}", reason) ParseError::Other(ref reason) => write!(formatter, "Failed to decode config: {}", reason)
} }
} }

View File

@ -224,10 +224,10 @@ pub enum Error {
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match *self { match *self {
Error::Parse(ref msg) => write!(formatter, "{}", msg), Error::Parse(msg) => write!(formatter, "{}", msg),
Error::Socket(ref msg, ref err) => write!(formatter, "{}: {:?}", msg, err), Error::Socket(msg, ref err) => write!(formatter, "{}: {:?}", msg, err),
Error::TunTapDev(ref msg, ref err) => write!(formatter, "{}: {:?}", msg, err), Error::TunTapDev(msg, ref err) => write!(formatter, "{}: {:?}", msg, err),
Error::Crypto(ref msg) => write!(formatter, "{}", msg), Error::Crypto(msg) => write!(formatter, "{}", msg),
Error::Name(ref name) => write!(formatter, "failed to resolve name '{}'", name), Error::Name(ref name) => write!(formatter, "failed to resolve name '{}'", name),
Error::WrongHeaderMagic(net) => write!(formatter, "wrong header magic: {}", bytes_to_hex(&net)), Error::WrongHeaderMagic(net) => write!(formatter, "wrong header magic: {}", bytes_to_hex(&net)),
} }