mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-20 18:12:15 +00:00
Use Cow<[u8]> for sort keys
This commit is contained in:
+4
-2
@@ -1,3 +1,5 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use garage_util::data::*;
|
||||
@@ -7,8 +9,8 @@ use crate::schema::*;
|
||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct EmptyKey;
|
||||
impl SortKey for EmptyKey {
|
||||
fn sort_key(&self) -> &[u8] {
|
||||
&[]
|
||||
fn sort_key(&self) -> Cow<'_, [u8]> {
|
||||
Cow::from(&[][..])
|
||||
}
|
||||
}
|
||||
impl PartitionKey for EmptyKey {
|
||||
|
||||
Reference in New Issue
Block a user