Skip to content

Commit 4cbb47e

Browse files
committed
0.6.1
1 parent e42cd8c commit 4cbb47e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "toolshed"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
authors = ["maciejhirsz <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Arena allocator and a handful of useful data structures"

src/arena.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,16 @@ impl<'arena> AsRef<str> for NulTermStr<'arena> {
117117
}
118118

119119
impl<'arena> Deref for NulTermStr<'arena> {
120-
type Target = str;
120+
type Target = &'arena str;
121121

122-
fn deref(&self) -> &str {
123-
self.0
122+
fn deref(&self) -> &&'arena str {
123+
&self.0
124+
}
125+
}
126+
127+
impl<'arena> From<NulTermStr<'arena>> for &'arena str {
128+
fn from(nts: NulTermStr<'arena>) -> &'arena str {
129+
nts.0
124130
}
125131
}
126132

0 commit comments

Comments
 (0)