Skip to content

Commit

Permalink
refactor: simplify op id from impls
Browse files Browse the repository at this point in the history
  • Loading branch information
jost-s committed Dec 14, 2024
1 parent ec06ac8 commit b395812
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/api/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::Arc;
use prost::Message;

use crate::{
builder, config, id::Id, peer_store::DynPeerStore, transport::DynTransport,
builder, config, peer_store::DynPeerStore, transport::DynTransport,
AgentId, BoxFut, K2Error, K2Result, OpId, SpaceId,
};

Expand All @@ -14,14 +14,14 @@ include!("../proto/gen/kitsune2.fetch.rs");
impl From<Vec<OpId>> for OpIds {
fn from(value: Vec<OpId>) -> Self {
Self {
data: value.into_iter().map(|op_id| op_id.0 .0).collect(),
data: value.into_iter().map(Into::into).collect(),
}
}
}

impl From<OpIds> for Vec<OpId> {
fn from(value: OpIds) -> Self {
value.data.into_iter().map(|id| OpId(Id(id))).collect()
value.data.into_iter().map(Into::into).collect()
}
}

Expand Down

0 comments on commit b395812

Please sign in to comment.