diff --git a/Cargo.lock b/Cargo.lock index 28e9b75cbdcb3c7e6cbc0a1759cd747a7f27d0d6..21ec9d8e7c6d71029247543ed9569e11a1512a67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,6 @@ dependencies = [ "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)", "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)", "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)", @@ -217,25 +216,6 @@ name = "matches" version = "0.1.4" 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]] name = "nodrop" version = "0.1.8" @@ -382,9 +362,6 @@ dependencies = [ name = "phf_shared" version = "0.7.19" 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]] name = "png" @@ -435,14 +412,6 @@ name = "rustc-serialize" version = "0.3.21" 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]] name = "rusttype" version = "0.2.1" @@ -474,11 +443,6 @@ dependencies = [ "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]] name = "serde" version = "0.8.17" @@ -547,14 +511,6 @@ dependencies = [ "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]] name = "unicode-bidi" version = "0.2.3" @@ -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 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 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 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" @@ -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 (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_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 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 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 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" @@ -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 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 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-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" diff --git a/Cargo.toml b/Cargo.toml index 6bc2321959b66cd322340df7b2e9bafe4f81be75..75fb19ff5c4d01b8d0dba2a3ca25e3fc34053491 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ path = "src/viewer/main.rs" [dependencies] html5ever = "*" html5ever-atoms = "*" -mime_guess = "*" +#mime_guess = "*" orbclient = "0.1" orbfont = "0.1" orbimage = "0.1" diff --git a/src/browser/main.rs b/src/browser/main.rs index fede59ae8a8ce0febc4d8a29440c852f13ef0266..d4009a2cbb0768f365a7265b019f40e008787ca6 100644 --- a/src/browser/main.rs +++ b/src/browser/main.rs @@ -1,6 +1,6 @@ #[macro_use] extern crate html5ever_atoms; extern crate html5ever; -extern crate mime_guess; +//extern crate mime_guess; extern crate orbclient; extern crate orbfont; extern crate orbimage; @@ -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>>) { if let Ok(path) = url.to_file_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 mime_type = mime_guess::get_mime_type_str(extension).unwrap_or("application/octet-stream"); println!("{:?}", mime_type); headers.push(format!("Content-Type: {}", mime_type)); - } + } */ read_parse(&headers, &mut file, url, &font, &font_bold, anchors, blocks); } else {