Skip to content

Commit 64e68d6

Browse files
committed
Add note on sequences
1 parent da0c7ce commit 64e68d6

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/actions.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ macro_rules! implement_actions {
126126
};
127127
}
128128

129-
implement_actions!(
129+
implement_actions! {
130130
/// Get the number of keys present in the database
131131
fn dbsize() -> u64 {
132132
{ Query::from("dbsize") }
@@ -203,6 +203,8 @@ implement_actions!(
203203
/// ```text
204204
/// MGET <k1> <k2> ...
205205
/// ```
206+
///
207+
/// **This method expects either:** `[T; N]`, `&[T; N]` or anything that derefs to `&[T]`
206208
fn mget<T: FromSkyhashBytes>(keys: impl IntoSkyhashAction+ 's) -> T {
207209
{ Query::from("mget").arg(keys)}
208210
x @ Element::Array(Array::Bin(_)) | x @ Element::Array(Array::Str(_)) => T::from_element(x)?
@@ -235,6 +237,8 @@ implement_actions!(
235237
///
236238
/// ## Panics
237239
/// This method will panic if the number of keys and values are not equal
240+
///
241+
/// **This method expects either:** `[T; N]`, `&[T; N]` or anything that derefs to `&[T]`
238242
fn mset<T: IntoSkyhashBytes + 's , U: IntoSkyhashBytes + 's>
239243
(
240244
keys: impl GetIterator<T> + 's,
@@ -257,6 +261,8 @@ implement_actions!(
257261
///
258262
/// ## Panics
259263
/// This method will panic if the number of keys and values are not equal
264+
///
265+
/// **This method expects either:** `[T; N]`, `&[T; N]` or anything that derefs to `&[T]`
260266
fn mupdate<T: IntoSkyhashBytes + 's , U: IntoSkyhashBytes + 's>
261267
(
262268
keys: impl GetIterator<T> + 's,
@@ -329,6 +335,8 @@ implement_actions!(
329335
///
330336
/// ## Panics
331337
/// This method will panic if the number of keys and values are not equal
338+
///
339+
/// **This method expects either:** `[T; N]`, `&[T; N]` or anything that derefs to `&[T]`
332340
fn sset<T: IntoSkyhashBytes + 's , U: IntoSkyhashBytes + 's>
333341
(
334342
keys: impl GetIterator<T> + 's,
@@ -353,8 +361,11 @@ implement_actions!(
353361
/// ```
354362
/// with the only difference that you have to pass in the keys and values as separate
355363
/// objects
364+
///
356365
/// ## Panics
357366
/// This method will panic if the number of keys and values are not equal
367+
///
368+
/// **This method expects either:** `[T; N]`, `&[T; N]` or anything that derefs to `&[T]`
358369
fn supdate<T: IntoSkyhashBytes + 's , U: IntoSkyhashBytes + 's>
359370
(
360371
keys: impl GetIterator<T> + 's,
@@ -391,6 +402,8 @@ implement_actions!(
391402
///
392403
/// ## Panics
393404
/// This method will panic if the number of keys is not equal to the number of values
405+
///
406+
/// **This method expects either:** `[T; N]`, `&[T; N]` or anything that derefs to `&[T]`
394407
fn uset<T: IntoSkyhashBytes + 's , U: IntoSkyhashBytes + 's>
395408
(
396409
keys: impl GetIterator<T> + 's,
@@ -405,4 +418,4 @@ implement_actions!(
405418
}
406419
Element::UnsignedInt(int) => int as u64
407420
}
408-
);
421+
}

src/types.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl<T: IntoSkyhashBytes, const N: usize> GetIterator<T> for &'static [T; N] {
270270
}
271271
}
272272

273-
impl<T: IntoSkyhashBytes> GetIterator<T> for &[T] {
273+
impl<'a, T: IntoSkyhashBytes> GetIterator<T> for &'a [T] {
274274
fn get_iter(&self) -> std::slice::Iter<'_, T> {
275275
self.iter()
276276
}
@@ -282,12 +282,6 @@ impl<T: IntoSkyhashBytes> GetIterator<T> for Vec<T> {
282282
}
283283
}
284284

285-
impl<T: IntoSkyhashBytes> GetIterator<T> for &Vec<T> {
286-
fn get_iter(&self) -> std::slice::Iter<'_, T> {
287-
self.iter()
288-
}
289-
}
290-
291285
/// Array types
292286
#[derive(Debug, PartialEq)]
293287
#[non_exhaustive]

0 commit comments

Comments
 (0)