Skip to content

Remove some and deny new indexing and slicing #1652

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 2 commits into from
Jul 11, 2020
Merged

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Jun 21, 2020

No description provided.

@link2xt
Copy link
Collaborator Author

link2xt commented Jun 21, 2020

One bug found so far: #1650

@link2xt link2xt force-pushed the indexing_slicing branch 4 times, most recently from b2773ca to 27a928e Compare July 8, 2020 14:22
@link2xt link2xt changed the title WIP: getting rid of indexing and slicing Remove some and deny new indexing and slicing Jul 8, 2020
@@ -239,6 +239,7 @@ impl MimeMessage {
///
/// Delta Chat sends attachments, such as images, in two-part messages, with the first message
/// containing an explanation. If such a message is detected, first part can be safely dropped.
#[allow(clippy::indexing_slicing)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be possible to replace the two parts[0] calls further down with textpart?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, borrow checker fails.

@link2xt link2xt force-pushed the indexing_slicing branch from 27a928e to 49ac2ab Compare July 11, 2020 18:19
@link2xt
Copy link
Collaborator Author

link2xt commented Jul 11, 2020

I'll merge when tests pass.

The goal is not to eliminate all the indexing and slicing we have already. Code we have now is pretty reliable already, but this should prevent addition of new indexing and slicing that may panic.

@link2xt link2xt merged commit 8efe7ca into master Jul 11, 2020
@link2xt link2xt deleted the indexing_slicing branch July 11, 2020 18:43
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.

2 participants