mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement range index with the Position enum on ServoUrl
This commit is contained in:
parent
22aebdf5d4
commit
0818b44459
6 changed files with 35 additions and 6 deletions
|
@ -35,7 +35,7 @@ pub type DecodeData = (Mime, Vec<u8>);
|
|||
pub fn decode(url: &ServoUrl) -> Result<DecodeData, DecodeError> {
|
||||
assert_eq!(url.scheme(), "data");
|
||||
// Split out content type and data.
|
||||
let parts: Vec<&str> = url.as_url().unwrap()[Position::BeforePath..Position::AfterQuery].splitn(2, ',').collect();
|
||||
let parts: Vec<&str> = url[Position::BeforePath..Position::AfterQuery].splitn(2, ',').collect();
|
||||
if parts.len() != 2 {
|
||||
return Err(DecodeError::InvalidDataUri);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue