Skip to content

rustdoc: Accept tabs as indentation character #29495

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

Merged
merged 1 commit into from
Nov 3, 2015
Merged

rustdoc: Accept tabs as indentation character #29495

merged 1 commit into from
Nov 3, 2015

Conversation

meqif
Copy link
Contributor

@meqif meqif commented Oct 31, 2015

A line may be indented with either spaces or tabs, but not a mix of both. If there is a mix of tabs and spaces, only the kind that occurs first is counted.

This addresses issue #29268.

@rust-highfive
Copy link
Contributor

r? @cmr

(rust_highfive has picked a reviewer for you, use r? to override)

@meqif
Copy link
Contributor Author

meqif commented Nov 1, 2015

Well, that's embarrassing. I didn't notice a call to trim a few lines below. That call to trim makes things a little trickier.

The way I see it, there are two options:

  • trim only one kind of whitespace on the left and leave the other alone (i.e., if the first character is a space, only spaces are trimmed, otherwise only tabs are trimmed),
  • trim all whitespace, regardless of it being mixed or not.

I'm not entirely sure what would be best.

@steveklabnik
Copy link
Member

I'm tempted to just say trim all whitespace.

@meqif
Copy link
Contributor Author

meqif commented Nov 1, 2015

That's fine by me.

I updated the fix and the tests. Give me the signal and I'll squash the commits.

@steveklabnik
Copy link
Member

Let's do it. r=me after a squash

A line may be indented with both spaces or tabs. All leading whitespace
is trimmed, even if it is mixed.
@meqif
Copy link
Contributor Author

meqif commented Nov 2, 2015

r? @steveklabnik

@meqif
Copy link
Contributor Author

meqif commented Nov 2, 2015

It's done. Thank you, @steveklabnik.

@steveklabnik
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Nov 3, 2015

📌 Commit a9cbf6c has been approved by steveklabnik

@bors
Copy link
Collaborator

bors commented Nov 3, 2015

⌛ Testing commit a9cbf6c with merge c143ae7...

bors added a commit that referenced this pull request Nov 3, 2015
A line may be indented with either spaces or tabs, but not a mix of both. If there is a mix of tabs and spaces, only the kind that occurs first is counted.

This addresses issue #29268.
@bors bors merged commit a9cbf6c into rust-lang:master Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants