Skip to content

Commit 3cfa8cd

Browse files
committed
Fix overeager find and replace usage
1 parent dbcde04 commit 3cfa8cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl Error {
7171
fn new_parse_error(s: Cow<'static, str>, input: &str, offset: usize) -> Error {
7272
let context = Cow::Borrowed(input.as_bytes().get(offset..).unwrap_or(&[]));
7373
let context = if context.len() > 20 {
74-
Cow::Owned(format!("{}..=", String::from_utf8_lossy(&context[..20])))
74+
Cow::Owned(format!("{}...", String::from_utf8_lossy(&context[..20])))
7575
} else {
7676
String::from_utf8_lossy(&context)
7777
};
@@ -767,7 +767,7 @@ impl<'a> ParserState<'a> {
767767
// <non-negative integer> ::= <decimal digit> # when 1 <= Number <= 10
768768
// ::= <hex digit>+ @ # when Numbrer == 0 or >= 10
769769
//
770-
// <hex-digit> ::= [A-P] # A = 0, B = 1, ..=
770+
// <hex-digit> ::= [A-P] # A = 0, B = 1, ...
771771
fn read_number(&mut self) -> Result<i32> {
772772
let neg = self.consume(b"?");
773773

@@ -815,7 +815,7 @@ impl<'a> ParserState<'a> {
815815
}
816816
}
817817

818-
// First 10 strings can be referenced by special names ?0, ?1, ..=, ?9.
818+
// First 10 strings can be referenced by special names ?0, ?1, ..., ?9.
819819
// Memorize it.
820820
fn memorize_name(&mut self, n: &Name<'a>) {
821821
// TODO: the contains check does an equality check on the Name enum, which
@@ -1666,7 +1666,7 @@ impl<'a> Serializer<'a> {
16661666
return Ok(());
16671667
}
16681668
Type::VarArgs => {
1669-
write!(self.w, "..=")?;
1669+
write!(self.w, "...")?;
16701670
return Ok(());
16711671
}
16721672
Type::Ptr(ref inner, storage_class)

0 commit comments

Comments
 (0)