mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
Auto merge of #16681 - mbrubeck:slice_patterns, r=emilio
Stop using unstable slice_patterns feature cc #5286 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] There are tests for these changes OR - [x] These changes do not require tests because no functionality changed <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16681) <!-- Reviewable:end -->
This commit is contained in:
commit
4426236adf
5 changed files with 5 additions and 10 deletions
|
@ -108,10 +108,7 @@ pub fn detect_image_format(buffer: &[u8]) -> Result<ImageFormat, &str> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_gif(buffer: &[u8]) -> bool {
|
fn is_gif(buffer: &[u8]) -> bool {
|
||||||
match buffer {
|
buffer.starts_with(b"GIF87a") || buffer.starts_with(b"GIF89a")
|
||||||
&[b'G', b'I', b'F', b'8', n, b'a', _..] if n == b'7' || n == b'9' => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_jpeg(buffer: &[u8]) -> bool {
|
fn is_jpeg(buffer: &[u8]) -> bool {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
#![feature(slice_patterns)]
|
|
||||||
#![feature(step_by)]
|
#![feature(step_by)]
|
||||||
|
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
|
|
|
@ -223,9 +223,9 @@ impl ChildrenList {
|
||||||
// by ChildrenMutation::replace().
|
// by ChildrenMutation::replace().
|
||||||
unreachable!()
|
unreachable!()
|
||||||
},
|
},
|
||||||
(_, &[node, ..], _) => node,
|
(_, added, _) if !added.is_empty() => added[0],
|
||||||
(_, &[], Some(next)) => next,
|
(_, _, Some(next)) => next,
|
||||||
(Some(prev), &[], None) => {
|
(Some(prev), _, None) => {
|
||||||
list.last_index.set(index - 1u32);
|
list.last_index.set(index - 1u32);
|
||||||
prev
|
prev
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
#![feature(plugin)]
|
#![feature(plugin)]
|
||||||
#![feature(proc_macro)]
|
#![feature(proc_macro)]
|
||||||
#![feature(slice_patterns)]
|
|
||||||
#![feature(stmt_expr_attributes)]
|
#![feature(stmt_expr_attributes)]
|
||||||
#![feature(try_from)]
|
#![feature(try_from)]
|
||||||
#![feature(untagged_unions)]
|
#![feature(untagged_unions)]
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
#![feature(box_syntax, plugin, plugin_registrar, rustc_private, slice_patterns)]
|
#![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rustc;
|
extern crate rustc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue