Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5
extern crate phf_codegen;
6
7
use std::env;
8
use std::fs::File;
9
use std::io::{BufWriter, Write};
10
use std::path::Path;
11
12
fn main() {
13
let path = Path::new(&env::var_os("OUT_DIR").unwrap())
14
.join("ascii_case_insensitive_html_attributes.rs");
15
let mut file = BufWriter::new(File::create(&path).unwrap());
16
17
write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ").unwrap();
18
let mut set = phf_codegen::Set::new();
19
for name in ASCII_CASE_INSENSITIVE_HTML_ATTRIBUTES.split_whitespace() {
20
set.entry(name);
21
}
22
set.build(&mut file).unwrap();
23
write!(&mut file, "; &SET }}").unwrap();
24
}
25
27
static ASCII_CASE_INSENSITIVE_HTML_ATTRIBUTES: &'static str = r#"
28
accept
29
accept-charset
30
align
31
alink
32
axis
33
bgcolor
34
charset
35
checked
36
clear
37
codetype
38
color
39
compact
40
declare
41
defer
42
dir
43
direction
44
disabled
45
enctype
46
face
47
frame
48
hreflang
49
http-equiv
50
lang
51
language
52
link
53
media
54
method
55
multiple
56
nohref
57
noresize
58
noshade
59
nowrap
60
readonly
61
rel
62
rev
63
rules
64
scope
65
scrolling
66
selected
67
shape
68
target
69
text
70
type
71
valign
72
valuetype
73
vlink
74
"#;