pub enum ClassDeclaration {
MultiLine,
SingleLine,
}Expand description
How a file-level class_name and its extends are laid out.
The style guide asks for two lines, and says so three ways: the prose
introduces them in sequence (“Follow with the optional @icon then the
class_name… Then, add the extends keyword”), every example writes
them apart, and inner classes are singled out for the opposite treatment —
“For inner classes, use single-line declarations”. That contrast only means
something if file-level declarations are not single-line, so
MultiLine is the default.
gdformat enforces neither: its grammar has a separate rule for the joined
form and it preserves whichever the author wrote. So a project arriving from
gdformat can be consistently on the one-line form without ever having
chosen it, and the first gdck format would rewrite most of its files.
SingleLine exists for a project that has looked at
that diff and decided it prefers what it already had.
Variants§
MultiLine
class_name Player and extends Node on their own lines.
SingleLine
class_name Player extends Node, as gdformat leaves it.
Trait Implementations§
Source§impl Clone for ClassDeclaration
impl Clone for ClassDeclaration
Source§fn clone(&self) -> ClassDeclaration
fn clone(&self) -> ClassDeclaration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ClassDeclaration
Source§impl Debug for ClassDeclaration
impl Debug for ClassDeclaration
Source§impl Default for ClassDeclaration
impl Default for ClassDeclaration
Source§fn default() -> ClassDeclaration
fn default() -> ClassDeclaration
impl Eq for ClassDeclaration
Source§impl PartialEq for ClassDeclaration
impl PartialEq for ClassDeclaration
impl StructuralPartialEq for ClassDeclaration
Auto Trait Implementations§
impl Freeze for ClassDeclaration
impl RefUnwindSafe for ClassDeclaration
impl Send for ClassDeclaration
impl Sync for ClassDeclaration
impl Unpin for ClassDeclaration
impl UnsafeUnpin for ClassDeclaration
impl UnwindSafe for ClassDeclaration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.