Code cleanup.

This commit is contained in:
Stephen Chung
2020-12-28 09:49:54 +08:00
parent 6b8d78d64c
commit 5c813ca7c0
7 changed files with 94 additions and 96 deletions

View File

@@ -91,7 +91,7 @@ impl fmt::Display for ScriptFnDef {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"{}{}({}) -> Dynamic",
"{}{}({})",
if self.access.is_private() {
"private "
} else {
@@ -133,7 +133,7 @@ impl fmt::Display for ScriptFnMetadata<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"{}{}({}) -> Dynamic",
"{}{}({})",
if self.access.is_private() {
"private "
} else {
@@ -646,7 +646,7 @@ impl AsRef<Module> for AST {
/// ## WARNING
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
#[derive(Clone, Eq, PartialEq, Hash)]
pub struct Ident {
/// Identifier name.
pub name: ImmutableString,
@@ -654,6 +654,12 @@ pub struct Ident {
pub pos: Position,
}
impl fmt::Debug for Ident {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Ident({:?} @ {:?})", self.name, self.pos)
}
}
/// _(INTERNALS)_ A type encapsulating the mode of a `return`/`throw` statement.
/// Exported under the `internals` feature only.
///