Reduce size of ParseState.

This commit is contained in:
Stephen Chung
2022-11-24 17:08:43 +08:00
parent b4ef89b596
commit c9d8714fe6
7 changed files with 211 additions and 242 deletions

View File

@@ -2,7 +2,7 @@
#![cfg(not(feature = "no_function"))]
use super::{FnAccess, StmtBlock};
use crate::{ImmutableString, StaticVec};
use crate::{FnArgsVec, ImmutableString};
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
use std::{fmt, hash::Hash};
@@ -42,7 +42,7 @@ pub struct ScriptFnDef {
/// Function access mode.
pub access: FnAccess,
/// Names of function parameters.
pub params: StaticVec<ImmutableString>,
pub params: FnArgsVec<ImmutableString>,
/// _(metadata)_ Function doc-comments (if any).
/// Exported under the `metadata` feature only.
///
@@ -72,7 +72,7 @@ impl fmt::Display for ScriptFnDef {
self.params
.iter()
.map(|s| s.as_str())
.collect::<StaticVec<_>>()
.collect::<FnArgsVec<_>>()
.join(", ")
)
}
@@ -121,7 +121,7 @@ impl fmt::Display for ScriptFnMetadata<'_> {
self.params
.iter()
.copied()
.collect::<StaticVec<_>>()
.collect::<FnArgsVec<_>>()
.join(", ")
)
}