ref_resolve_bytes
/resolve_bytes_map
This commit is contained in:
parent
c32c83de4f
commit
a43f1dbf27
@ -26,6 +26,10 @@ pub trait OriginMap<'a, Ctx: Context<'a>>: Origin<'a, Ctx> {
|
||||
self.clone().resolve()
|
||||
}
|
||||
|
||||
fn ref_resolve_bytes(self: &Arc<Self>) -> HashResolution<'a, Ctx> {
|
||||
self.clone().resolve_bytes()
|
||||
}
|
||||
|
||||
fn resolve_map<T: 'a + Send>(
|
||||
self: &Arc<Self>,
|
||||
f: impl 'a + Send + FnOnce(ResolutionResult<'a, Ctx, Self::Mtbl>) -> T,
|
||||
@ -35,6 +39,13 @@ pub trait OriginMap<'a, Ctx: Context<'a>>: Origin<'a, Ctx> {
|
||||
{
|
||||
Ctx::fmap(self.ref_resolve(), f)
|
||||
}
|
||||
|
||||
fn resolve_bytes_map<T: 'a + Send>(
|
||||
self: &Arc<Self>,
|
||||
f: impl 'a + Send + FnOnce(HashResolutionResult<'a, Ctx>) -> T,
|
||||
) -> Wrapped<'a, Ctx, T> {
|
||||
Ctx::fmap(self.ref_resolve_bytes(), f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, Ctx: Context<'a>, R: ?Sized + Origin<'a, Ctx>> OriginMap<'a, Ctx> for R {}
|
||||
|
@ -201,7 +201,7 @@ fn cast_origin<'a, Ctx: CastCtx<'a>, A: Mentionable<'a, Ctx>>(
|
||||
wrapped_origin(
|
||||
factory.clone(),
|
||||
move || cast_resolve(typeless_origin.clone(), factory.clone()),
|
||||
move || origin_rb.clone().resolve_bytes(),
|
||||
move || origin_rb.ref_resolve_bytes(),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> SingularResolution<'a, Ctx>
|
||||
for Point<'a, Ctx, A>
|
||||
{
|
||||
fn singular(self: Arc<Self>) -> HashResolution<'a, Ctx> {
|
||||
self.origin.clone().resolve_bytes()
|
||||
self.origin.ref_resolve_bytes()
|
||||
}
|
||||
|
||||
fn s_hash(&self) -> Hash {
|
||||
|
@ -39,7 +39,7 @@ pub trait MappableOrigin<'a, Ctx: Context<'a>>: Origin<'a, Ctx> {
|
||||
let map_err = map_err.clone();
|
||||
map_resolve(move || origin.ref_resolve(), map_ok, map_err)
|
||||
}),
|
||||
w_resolve_bytes: Box::new(move || origin_rb.clone().resolve_bytes()),
|
||||
w_resolve_bytes: Box::new(move || origin_rb.ref_resolve_bytes()),
|
||||
};
|
||||
Arc::new(origin)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user