Skip to content

Commit 9abce78

Browse files
committed
Display for Namespace
1 parent e7cfb8e commit 9abce78

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "string_cache"
4-
version = "0.2.23"
4+
version = "0.2.24"
55
authors = [ "The Servo Project Developers" ]
66
description = "A string interning library for Rust, developed as part of the Servo project."
77
license = "MIT / Apache-2.0"

src/namespace.rs

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//! **Note:** This may move as string-cache becomes less Web-specific.
1111
1212
use atom::Atom;
13+
use std::fmt;
1314
use std::ops;
1415

1516
/// An atom that is meant to represent a namespace in the HTML / XML sense.
@@ -36,6 +37,13 @@ impl<'a> PartialEq<Namespace> for BorrowedNamespace<'a> {
3637
}
3738
}
3839

40+
impl fmt::Display for Namespace {
41+
#[inline]
42+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
43+
<str as fmt::Display>::fmt(&self.0, f)
44+
}
45+
}
46+
3947
/// A name with a namespace.
4048
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
4149
pub struct QualName {

0 commit comments

Comments
 (0)