Use SmartString for comments.

This commit is contained in:
Stephen Chung 2023-02-11 23:55:07 +08:00
parent dbac4d5689
commit 8685323b15
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ pub struct ScriptFnDef {
/// ///
/// Each line in non-block doc-comments starts with `///`. /// Each line in non-block doc-comments starts with `///`.
#[cfg(feature = "metadata")] #[cfg(feature = "metadata")]
pub comments: Box<[crate::Identifier]>, pub comments: Box<[crate::SmartString]>,
} }
impl fmt::Display for ScriptFnDef { impl fmt::Display for ScriptFnDef {

View File

@ -27,7 +27,7 @@ impl Hasher for StraightHasher {
fn finish(&self) -> u64 { fn finish(&self) -> u64 {
self.0 self.0
} }
#[inline(always)] #[cold]
fn write(&mut self, _bytes: &[u8]) { fn write(&mut self, _bytes: &[u8]) {
panic!("StraightHasher can only hash u64 values"); panic!("StraightHasher can only hash u64 values");
} }

View File

@ -85,7 +85,7 @@ pub struct FuncInfoMetadata {
pub return_type: Identifier, pub return_type: Identifier,
/// Comments. /// Comments.
#[cfg(feature = "metadata")] #[cfg(feature = "metadata")]
pub comments: Box<[Identifier]>, pub comments: Box<[SmartString]>,
} }
/// A type containing a single registered function. /// A type containing a single registered function.