Skip to content
Snippets Groups Projects
Commit a2d1b4d4 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Do not use mime_guess until it compiles on Redox

parent 5e5d1f16
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,6 @@ dependencies = [ ...@@ -5,7 +5,6 @@ dependencies = [
"html5ever 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"mime_guess 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"orbclient 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "orbclient 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"orbfont 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "orbfont 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"orbimage 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "orbimage 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -217,25 +216,6 @@ name = "matches" ...@@ -217,25 +216,6 @@ name = "matches"
version = "0.1.4" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mime"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mime_guess"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_codegen 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "nodrop" name = "nodrop"
version = "0.1.8" version = "0.1.8"
...@@ -382,9 +362,6 @@ dependencies = [ ...@@ -382,9 +362,6 @@ dependencies = [
name = "phf_shared" name = "phf_shared"
version = "0.7.19" version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "png" name = "png"
...@@ -435,14 +412,6 @@ name = "rustc-serialize" ...@@ -435,14 +412,6 @@ name = "rustc-serialize"
version = "0.3.21" version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc_version"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "rusttype" name = "rusttype"
version = "0.2.1" version = "0.2.1"
...@@ -474,11 +443,6 @@ dependencies = [ ...@@ -474,11 +443,6 @@ dependencies = [
"num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "semver"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "serde" name = "serde"
version = "0.8.17" version = "0.8.17"
...@@ -547,14 +511,6 @@ dependencies = [ ...@@ -547,14 +511,6 @@ dependencies = [
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "unicase"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.2.3" version = "0.2.3"
...@@ -643,8 +599,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -643,8 +599,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
"checksum mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1b1db08c0d0ddbb591e65f1da58d1cefccc94a2faa0c55bf979ce215a3e04d5e" "checksum mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1b1db08c0d0ddbb591e65f1da58d1cefccc94a2faa0c55bf979ce215a3e04d5e"
"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1"
"checksum mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5c93a4bd787ddc6e7833c519b73a50883deb5863d76d9b71eb8216fb7f94e66"
"checksum mime_guess 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76da6df85047af8c0edfa53f48eb1073012ce1cc95c8fedc0a374f659a89dd65"
"checksum nodrop 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbadd3f4c98dea0bd3d9b4be4c0cdaf1ab57035cb2e41fce3983db5add7cc5" "checksum nodrop 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbadd3f4c98dea0bd3d9b4be4c0cdaf1ab57035cb2e41fce3983db5add7cc5"
"checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120" "checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120"
"checksum num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "88b14378471f7c2adc5262f05b4701ef53e8da376453a8d8fee48e51db745e49" "checksum num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "88b14378471f7c2adc5262f05b4701ef53e8da376453a8d8fee48e51db745e49"
...@@ -670,11 +624,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -670,11 +624,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum redox_syscall 0.1.1 (git+https://github.com/redox-os/syscall.git)" = "<none>" "checksum redox_syscall 0.1.1 (git+https://github.com/redox-os/syscall.git)" = "<none>"
"checksum redox_syscall 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6bad9ae07bd11e07d9117d846c479e7e7f6a6b4221af5119781dcc4996e743a" "checksum redox_syscall 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6bad9ae07bd11e07d9117d846c479e7e7f6a6b4221af5119781dcc4996e743a"
"checksum rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)" = "bff9fc1c79f2dec76b253273d07682e94a978bd8f132ded071188122b2af9818" "checksum rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)" = "bff9fc1c79f2dec76b253273d07682e94a978bd8f132ded071188122b2af9818"
"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
"checksum rusttype 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c64ffc93b0cc5a6f5e5e84da2a4082b0271e0a1dd76e821bdac570bda7797e" "checksum rusttype 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c64ffc93b0cc5a6f5e5e84da2a4082b0271e0a1dd76e821bdac570bda7797e"
"checksum sdl2 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9cf70f3d302b61311856bcbd9c9d000aadc7c595574214335cf09035fdced2c9" "checksum sdl2 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9cf70f3d302b61311856bcbd9c9d000aadc7c595574214335cf09035fdced2c9"
"checksum sdl2-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "657e3a3a175fda33c05d943923a768c7bf94c3b5fad05dcb31fc0321b11f47bd" "checksum sdl2-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "657e3a3a175fda33c05d943923a768c7bf94c3b5fad05dcb31fc0321b11f47bd"
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
"checksum serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "784e249221c84265caeb1e2fe48aeada86f67f5acb151bd3903c4585969e43f6" "checksum serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "784e249221c84265caeb1e2fe48aeada86f67f5acb151bd3903c4585969e43f6"
"checksum stb_truetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0955c15cfb412f0c4fdfb3d07d2b1915869e472b35646cc3a3a104a8f79517b" "checksum stb_truetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0955c15cfb412f0c4fdfb3d07d2b1915869e472b35646cc3a3a104a8f79517b"
"checksum string_cache 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d192db2123fac37399e1ca61557904a5c3fb6fc24c73d2e47b15d20dc32470" "checksum string_cache 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d192db2123fac37399e1ca61557904a5c3fb6fc24c73d2e47b15d20dc32470"
...@@ -683,7 +635,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -683,7 +635,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "76c2db66dc579998854d84ff0ff4a81cb73e69596764d144ce7cece4d04ce6b5" "checksum syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "76c2db66dc579998854d84ff0ff4a81cb73e69596764d144ce7cece4d04ce6b5"
"checksum tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cebf864c2d90394a1b66d6fe45963f9a177f2af81a0edea5060f77627f9c4587" "checksum tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cebf864c2d90394a1b66d6fe45963f9a177f2af81a0edea5060f77627f9c4587"
"checksum termion 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d94a5aea537a27dd9412585d7d77f2c382a2361f2b6a7cf0a6a56ea04aa5b71a" "checksum termion 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d94a5aea537a27dd9412585d7d77f2c382a2361f2b6a7cf0a6a56ea04aa5b71a"
"checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764"
"checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f" "checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f"
"checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172" "checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172"
"checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" "checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb"
......
...@@ -46,7 +46,7 @@ path = "src/viewer/main.rs" ...@@ -46,7 +46,7 @@ path = "src/viewer/main.rs"
[dependencies] [dependencies]
html5ever = "*" html5ever = "*"
html5ever-atoms = "*" html5ever-atoms = "*"
mime_guess = "*" #mime_guess = "*"
orbclient = "0.1" orbclient = "0.1"
orbfont = "0.1" orbfont = "0.1"
orbimage = "0.1" orbimage = "0.1"
......
#[macro_use] extern crate html5ever_atoms; #[macro_use] extern crate html5ever_atoms;
extern crate html5ever; extern crate html5ever;
extern crate mime_guess; //extern crate mime_guess;
extern crate orbclient; extern crate orbclient;
extern crate orbfont; extern crate orbfont;
extern crate orbimage; extern crate orbimage;
...@@ -477,14 +477,14 @@ fn read_parse<'a, R: Read>(headers: &Vec<String>, r: &mut R, url: &Url, font: &' ...@@ -477,14 +477,14 @@ fn read_parse<'a, R: Read>(headers: &Vec<String>, r: &mut R, url: &Url, font: &'
fn file_parse<'a>(url: &Url, font: &'a Font, font_bold: &'a Font, anchors: &mut BTreeMap<String, i32>, blocks: &mut Vec<Block<'a>>) { fn file_parse<'a>(url: &Url, font: &'a Font, font_bold: &'a Font, anchors: &mut BTreeMap<String, i32>, blocks: &mut Vec<Block<'a>>) {
if let Ok(path) = url.to_file_path() { if let Ok(path) = url.to_file_path() {
if let Ok(mut file) = File::open(&path) { if let Ok(mut file) = File::open(&path) {
let mut headers = Vec::new(); let headers = Vec::new();
{ /* TODO {
let extension = path.extension().unwrap_or(OsStr::new("")).to_str().unwrap_or(""); let extension = path.extension().unwrap_or(OsStr::new("")).to_str().unwrap_or("");
let mime_type = mime_guess::get_mime_type_str(extension).unwrap_or("application/octet-stream"); let mime_type = mime_guess::get_mime_type_str(extension).unwrap_or("application/octet-stream");
println!("{:?}", mime_type); println!("{:?}", mime_type);
headers.push(format!("Content-Type: {}", mime_type)); headers.push(format!("Content-Type: {}", mime_type));
} } */
read_parse(&headers, &mut file, url, &font, &font_bold, anchors, blocks); read_parse(&headers, &mut file, url, &font, &font_bold, anchors, blocks);
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment