Skip to content
This repository was archived by the owner on Apr 20, 2020. It is now read-only.

Commit d599c66

Browse files
committed
Rename array's 'Index' to 'ArrayIndex'
- Avoid confusion with std::ops::Index - Avoid confusion with RediSearch Index
1 parent 8e2ae71 commit d599c66

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.rs renamed to src/array_index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
pub(crate) trait Index {
1+
pub(crate) trait ArrayIndex {
22
fn normalize(self, len: i64) -> usize;
33
}
44

5-
impl Index for i64 {
5+
impl ArrayIndex for i64 {
66
fn normalize(self, len: i64) -> usize {
77
let index = if self < 0 {
88
len - len.min(-self)

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ use redismodule::{Context, NextArg, RedisError, RedisResult, RedisValue, REDIS_O
88
use serde_json::{Number, Value};
99
use std::{i64, usize};
1010

11+
mod array_index;
1112
mod backward;
1213
mod error;
13-
mod index;
1414
mod nodevisitor;
1515
mod redisjson;
1616
mod schema;
1717

18+
use crate::array_index::ArrayIndex;
1819
use crate::error::Error;
19-
use crate::index::Index;
2020
use crate::redisjson::{Format, RedisJSON, SetOptions};
2121

2222
static REDIS_JSON_TYPE: RedisType = RedisType::new(

0 commit comments

Comments
 (0)