aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/string_reader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-brigadier/src/string_reader.rs')
-rw-r--r--azalea-brigadier/src/string_reader.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/azalea-brigadier/src/string_reader.rs b/azalea-brigadier/src/string_reader.rs
index 4b390155..403b8e99 100644
--- a/azalea-brigadier/src/string_reader.rs
+++ b/azalea-brigadier/src/string_reader.rs
@@ -18,6 +18,14 @@ impl From<String> for StringReader {
Self { string, cursor: 0 }
}
}
+impl From<&str> for StringReader {
+ fn from(string: &str) -> Self {
+ Self {
+ string: string.to_string(),
+ cursor: 0,
+ }
+ }
+}
impl StringReader {
pub fn string(&self) -> &str {