Skip to content

Commit ff64af1

Browse files
committed
logging: remove useless error string in Level conversion
The error message should be constructed by the caller if needed, and explain the context of the error in more abstract terms, not such low-level wrapper implementation details.
1 parent 07215b2 commit ff64af1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scylla-rust-wrapper/src/logging.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl From<Level> for CassLogLevel {
5454
}
5555

5656
impl TryFrom<CassLogLevel> for Level {
57-
type Error = String;
57+
type Error = ();
5858

5959
fn try_from(log_level: CassLogLevel) -> Result<Self, Self::Error> {
6060
let level = match log_level {
@@ -64,7 +64,7 @@ impl TryFrom<CassLogLevel> for Level {
6464
CassLogLevel::CASS_LOG_WARN => Level::WARN,
6565
CassLogLevel::CASS_LOG_ERROR => Level::ERROR,
6666
CassLogLevel::CASS_LOG_CRITICAL => Level::ERROR,
67-
_ => return Err("Error while converting CassLogLevel to Level".to_string()),
67+
_ => return Err(()),
6868
};
6969

7070
Ok(level)

0 commit comments

Comments
 (0)