aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/build.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2019-10-16 14:07:39 +0200
committerAnthony Ramine <nox@nox.paris>2019-10-23 15:34:48 +0200
commit785a344e32db58d4e631fd3cae17fd1f29a721ab (patch)
tree49a88fd3b94976139625e05057aeade760f1bb77 /components/script/build.rs
parent4f8cfd9b489f93ecf9cb1db8e9cdd330a98ffcbf (diff)
downloadservo-785a344e32db58d4e631fd3cae17fd1f29a721ab.tar.gz
servo-785a344e32db58d4e631fd3cae17fd1f29a721ab.zip
Update rand to 0.7 (fixes #24448)
Diffstat (limited to 'components/script/build.rs')
-rw-r--r--components/script/build.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/build.rs b/components/script/build.rs
index ea2e756490b..d8d65b098db 100644
--- a/components/script/build.rs
+++ b/components/script/build.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-use phf_shared;
+use phf_shared::{self, FmtConst};
use serde_json::{self, Value};
use std::env;
use std::fmt;
@@ -40,18 +40,17 @@ fn main() {
let mut phf = File::create(&phf).unwrap();
write!(
&mut phf,
- "pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = "
+ "pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = {};\n",
+ map.build(),
)
.unwrap();
- map.build(&mut phf).unwrap();
- write!(&mut phf, ";\n").unwrap();
}
#[derive(Eq, Hash, PartialEq)]
struct Bytes<'a>(&'a str);
-impl<'a> fmt::Debug for Bytes<'a> {
- fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+impl<'a> FmtConst for Bytes<'a> {
+ fn fmt_const(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
// https://github.com/rust-lang/rust/issues/55223
// should technically be just `write!(formatter, "b\"{}\"", self.0)
// but the referenced issue breaks promotion in the surrounding code