Add missing #[inline] for <_ as Deref>::deref()

This commit is contained in:
René Kijewski 2025-06-17 05:25:40 +02:00
parent 9c67e2a7d9
commit 53f4eb0b81
3 changed files with 5 additions and 1 deletions

View File

@ -229,6 +229,7 @@ pub(crate) struct SyntaxAndCache<'a> {
impl<'a> Deref for SyntaxAndCache<'a> {
type Target = Syntax<'a>;
#[inline]
fn deref(&self) -> &Self::Target {
&self.syntax
}
@ -240,6 +241,7 @@ struct OwnedSyntaxAndCacheKey(SyntaxAndCacheKey<'static>);
impl Deref for OwnedSyntaxAndCacheKey {
type Target = SyntaxAndCacheKey<'static>;
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}

View File

@ -634,8 +634,9 @@ impl<'a> WritableBuffer<'a> {
impl<'a> Deref for WritableBuffer<'a> {
type Target = [Writable<'a>];
#[inline]
fn deref(&self) -> &Self::Target {
&self.buf[..]
self.buf.as_slice()
}
}

View File

@ -222,6 +222,7 @@ impl<'a, T> WithSpan<'a, T> {
impl<T> Deref for WithSpan<'_, T> {
type Target = T;
#[inline]
fn deref(&self) -> &Self::Target {
&self.inner
}