aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-01 21:48:33 -0500
committerGitHub <noreply@github.com>2017-05-01 21:48:33 -0500
commit4426236adfac2de779ff68b47176f7bf36a74e20 (patch)
treeadaf42c20eeff4d205f839a599a8293ffc58ad5d /components
parent8850a01b81f87b481eb56287b7928c64890ba1a9 (diff)
parent10478b4fa3334635827aefd0cb8baa4b921d44f0 (diff)
downloadservo-4426236adfac2de779ff68b47176f7bf36a74e20.tar.gz
servo-4426236adfac2de779ff68b47176f7bf36a74e20.zip
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 -->
Diffstat (limited to 'components')
-rw-r--r--components/net_traits/image/base.rs5
-rw-r--r--components/net_traits/lib.rs1
-rw-r--r--components/script/dom/nodelist.rs6
-rw-r--r--components/script/lib.rs1
-rw-r--r--components/script_plugins/lib.rs2
5 files changed, 5 insertions, 10 deletions
diff --git a/components/net_traits/image/base.rs b/components/net_traits/image/base.rs
index a6bc08ce22f..cae3cce8dde 100644
--- a/components/net_traits/image/base.rs
+++ b/components/net_traits/image/base.rs
@@ -108,10 +108,7 @@ pub fn detect_image_format(buffer: &[u8]) -> Result<ImageFormat, &str> {
}
fn is_gif(buffer: &[u8]) -> bool {
- match buffer {
- &[b'G', b'I', b'F', b'8', n, b'a', _..] if n == b'7' || n == b'9' => true,
- _ => false,
- }
+ buffer.starts_with(b"GIF87a") || buffer.starts_with(b"GIF89a")
}
fn is_jpeg(buffer: &[u8]) -> bool {
diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs
index 7f6df9eb9ff..cbe8e2aad42 100644
--- a/components/net_traits/lib.rs
+++ b/components/net_traits/lib.rs
@@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(box_syntax)]
-#![feature(slice_patterns)]
#![feature(step_by)]
#![deny(unsafe_code)]
diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs
index 5c0983ccaa3..fae181f7d81 100644
--- a/components/script/dom/nodelist.rs
+++ b/components/script/dom/nodelist.rs
@@ -223,9 +223,9 @@ impl ChildrenList {
// by ChildrenMutation::replace().
unreachable!()
},
- (_, &[node, ..], _) => node,
- (_, &[], Some(next)) => next,
- (Some(prev), &[], None) => {
+ (_, added, _) if !added.is_empty() => added[0],
+ (_, _, Some(next)) => next,
+ (Some(prev), _, None) => {
list.last_index.set(index - 1u32);
prev
},
diff --git a/components/script/lib.rs b/components/script/lib.rs
index 57e7133638f..678603ee60f 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -12,7 +12,6 @@
#![feature(optin_builtin_traits)]
#![feature(plugin)]
#![feature(proc_macro)]
-#![feature(slice_patterns)]
#![feature(stmt_expr_attributes)]
#![feature(try_from)]
#![feature(untagged_unions)]
diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs
index 3c0f67fa6ab..b35acdf3109 100644
--- a/components/script_plugins/lib.rs
+++ b/components/script_plugins/lib.rs
@@ -15,7 +15,7 @@
#![deny(unsafe_code)]
-#![feature(box_syntax, plugin, plugin_registrar, rustc_private, slice_patterns)]
+#![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
#[macro_use]
extern crate rustc;