Skip to content

Commit

Permalink
Format fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirShpilraien committed Mar 9, 2023
1 parent 5b56dc1 commit 55e1a8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/ctx_flags.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[macro_use]
extern crate redis_module;

use redis_module::{Context, RedisResult, RedisString, RedisValue, ContextFlags};
use redis_module::{Context, ContextFlags, RedisResult, RedisString, RedisValue};

fn role(ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
Ok(RedisValue::SimpleStringStatic(
Expand Down
8 changes: 5 additions & 3 deletions src/context/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bitflags::bitflags;
use std::ffi::CString;
use std::os::raw::{c_char, c_int, c_long, c_longlong};
use std::ptr;
use bitflags::bitflags;

use crate::key::{RedisKey, RedisKeyWritable};
use crate::raw::{ModuleOptions, Version};
Expand Down Expand Up @@ -417,7 +417,9 @@ impl Context {
/// * Loading RDB/AOF
/// * Execution mode such as multi exec or Lua
pub fn get_flags(&self) -> ContextFlags {
ContextFlags::from_bits_truncate(unsafe { raw::RedisModule_GetContextFlags.unwrap()(self.ctx) as u32 } as c_int)
ContextFlags::from_bits_truncate(unsafe {
raw::RedisModule_GetContextFlags.unwrap()(self.ctx) as u32
} as c_int)
}
}

Expand Down Expand Up @@ -456,7 +458,7 @@ bitflags! {

/// The instance is a master
const MASTER = raw::REDISMODULE_CTX_FLAGS_MASTER as c_int;

/// The instance is a SLAVE
const SLAVE = raw::REDISMODULE_CTX_FLAGS_SLAVE as c_int;

Expand Down

0 comments on commit 55e1a8b

Please sign in to comment.