-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fixed the deprecated as_slice
warning...
#7741
Conversation
Hmm, we could have something else... |
Why not call slice::ref_slice instead of inlining it? |
Replacing safe code with unsafe code seems not great. This is making the code worse. What other workarounds are available for the lack of as_slice? |
Yep, I should've gone for |
88944c4
to
188f5d4
Compare
}, | ||
None => { | ||
let empty_arr: &[_] = &[]; | ||
empty_arr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these two lines be combined into a single &[]
expression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course...
188f5d4
to
35d7ced
Compare
@bors-servo: r+ |
📌 Commit 35d7ced has been approved by |
Thanks! :) |
fixed the deprecated `as_slice` warning... I've put its original implementation from [`core/option.rs`](http://doc.servo.org/src/core/option.rs.html#692) instead of the dear departed `as_slice` <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7741) <!-- Reviewable:end -->
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt |
I've put its original implementation from
core/option.rs
instead of the dear departedas_slice