File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -133,15 +133,12 @@ impl ToCassError for DbError {
133133 DbError :: ConfigError => CassError :: CASS_ERROR_SERVER_CONFIG_ERROR ,
134134 DbError :: AlreadyExists { .. } => CassError :: CASS_ERROR_SERVER_ALREADY_EXISTS ,
135135 DbError :: Unprepared { .. } => CassError :: CASS_ERROR_SERVER_UNPREPARED ,
136- DbError :: Other ( num) =>
137- {
138- #[ allow(
139- clippy:: unnecessary_cast,
140- reason = "C enum backing type on MSVC is i32)"
141- ) ]
142- CassError (
143- ( ( CassErrorSource :: CASS_ERROR_SOURCE_SERVER . 0 as u32 ) << 24 ) | * num as u32 ,
144- )
136+ DbError :: Other ( num) => {
137+ // On windows enums are i32, so we need to cast it
138+ #[ allow( clippy:: unnecessary_cast) ]
139+ let source = CassErrorSource :: CASS_ERROR_SOURCE_SERVER . 0 as u32 ;
140+ let code = ( source << 24 ) | ( * num as u32 ) ;
141+ CassError ( code as _ )
145142 }
146143 // TODO: add appropriate error if rate limit reached
147144 DbError :: RateLimitReached { .. } => CassError :: CASS_ERROR_SERVER_UNAVAILABLE ,
You can’t perform that action at this time.
0 commit comments