aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/string_reader.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-01-09 14:58:14 -0600
committermat <github@matdoes.dev>2022-01-09 14:58:14 -0600
commit4626bd45cd8b3875a0ee006cf8e2c7cfb9f8cbcc (patch)
tree37023c3379cad3eaf89e74908a9cb9c2eddb08e3 /azalea-brigadier/src/string_reader.rs
parent8331851d972b42b68e1fb64e2ec9faef6c02be32 (diff)
downloadazalea-drasl-4626bd45cd8b3875a0ee006cf8e2c7cfb9f8cbcc.tar.xz
fix a couple tests
Diffstat (limited to 'azalea-brigadier/src/string_reader.rs')
-rw-r--r--azalea-brigadier/src/string_reader.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea-brigadier/src/string_reader.rs b/azalea-brigadier/src/string_reader.rs
index 1119403a..4ef35ac0 100644
--- a/azalea-brigadier/src/string_reader.rs
+++ b/azalea-brigadier/src/string_reader.rs
@@ -187,7 +187,7 @@ impl StringReader<'_> {
pub fn read_unquoted_string(&mut self) -> &str {
let start = self.cursor;
- while self.can_read() && StringReader::<'_>::is_allowed_in_unquoted_string(self.peek()) {
+ while self.can_read() && StringReader::is_allowed_in_unquoted_string(self.peek()) {
self.skip();
}
&self.string[start..self.cursor]
@@ -395,7 +395,7 @@ mod test {
let mut reader = StringReader::from("hello world");
assert_eq!(reader.read_unquoted_string(), "hello");
assert_eq!(reader.get_read(), "hello");
- assert_eq!(reader.remaining(), "world");
+ assert_eq!(reader.remaining(), " world");
}
#[test]
@@ -417,7 +417,7 @@ mod test {
#[test]
fn read_quoted_string() {
let mut reader = StringReader::from("\"hello world\"");
- assert_eq!(reader.read_unquoted_string(), "hello world");
+ assert_eq!(reader.read_quoted_string().unwrap(), "hello world");
assert_eq!(reader.get_read(), "\"hello world\"");
assert_eq!(reader.remaining(), "");
}