Skip to content

Commit a39a627

Browse files
Add inline hint to methods that defer to the view
1 parent 8fa2c10 commit a39a627

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/string.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ impl<const N: usize> String<N> {
109109
/// let s: String<12> = String::try_from("Hello").unwrap();
110110
/// let view: &StringView = &s;
111111
/// ```
112+
#[inline]
112113
pub fn as_view(&self) -> &StringView {
113114
self
114115
}
@@ -128,6 +129,7 @@ impl<const N: usize> String<N> {
128129
/// let mut s: String<12> = String::try_from("Hello").unwrap();
129130
/// let view: &mut StringView = &mut s;
130131
/// ```
132+
#[inline]
131133
pub fn as_mut_view(&mut self) -> &mut StringView {
132134
self
133135
}
@@ -352,6 +354,7 @@ impl<const N: usize> String<N> {
352354
/// assert_eq!(s, "olleh");
353355
/// # Ok::<(), ()>(())
354356
/// ```
357+
#[inline]
355358
pub unsafe fn as_mut_vec_view(&mut self) -> &mut VecView<u8> {
356359
self.as_mut_view().as_mut_vec_view()
357360
}

0 commit comments

Comments
 (0)