Add deref impl

This commit is contained in:
Aode (lion) 2021-10-06 18:54:50 -05:00
parent 125cf814c7
commit cd7dd5fed7

View file

@ -2,6 +2,7 @@ use std::{
borrow::{Borrow, Cow},
fmt::{Debug, Display},
marker::PhantomData,
ops::Deref,
str::{from_utf8, Utf8Error},
};
@ -309,6 +310,22 @@ where
}
}
impl<Inner, Segment> Deref for Node<Inner, Segment> {
type Target = Segment;
fn deref(&self) -> &Self::Target {
self.segment()
}
}
impl<Inner, Segment> Deref for Field<Inner, Segment> {
type Target = Segment;
fn deref(&self) -> &Self::Target {
self.segment()
}
}
mod hidden {
pub trait Construct {
fn construct(&self) -> Vec<u8>;