We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75e9889 commit 085344cCopy full SHA for 085344c
1 file changed
src/symbol.rs
@@ -42,10 +42,18 @@ impl Symbol {
42
pub fn unqualified(&self) -> Symbol {
43
Symbol::intern(&self.name)
44
}
45
+ pub fn has_ns(&self) -> bool {
46
+ self.ns != ""
47
+ }
48
49
impl fmt::Display for Symbol {
50
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}", self.name)
51
+ if self.has_ns() {
52
+ write!(f, "{}/{}", self.ns, self.name)
53
54
+ else {
55
+ write!(f, "{}", self.name)
56
57
58
59
mod tests {
0 commit comments