Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on latest Rust #63

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ fn slice_eq_case_insensitive(input: &str, state: &mut ParseState, pos: usize,
let mut used = 0usize;
let mut input_iter = input[pos..].chars();
for m_char in m.chars() {
let m_char_upper = m_char.to_uppercase();
let m_char_upper = m_char.to_uppercase().next().unwrap();
used += m_char_upper.len_utf8();
let input_char_result = input_iter.next();
if input_char_result.is_none() ||
input_char_result.unwrap().to_uppercase() != m_char_upper {
input_char_result.unwrap().to_uppercase().next().unwrap() !=
m_char_upper {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this line into two because it made bootstrap.sh happy.

return state.mark_failure(pos, m);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ pub fn header_items(ctxt: &rustast::ExtCtxt) -> Vec<rustast::P<rustast::Item>> {
let mut input_iter = input[pos..].chars();

for m_char in m.chars() {
let m_char_upper = m_char.to_uppercase();
let m_char_upper = m_char.to_uppercase().next().unwrap();
used += m_char_upper.len_utf8();

let input_char_result = input_iter.next();

if input_char_result.is_none()
|| input_char_result.unwrap().to_uppercase() != m_char_upper {
|| input_char_result.unwrap().to_uppercase().next().unwrap() != m_char_upper {
return state.mark_failure(pos, m);
}
}
Expand Down