mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove some as_slice calls.
This commit is contained in:
parent
4ee89363fb
commit
6a55ae06d7
34 changed files with 79 additions and 79 deletions
|
@ -233,7 +233,7 @@ impl ImageCache {
|
|||
ResponseAction::HeadersAvailable(_) => {}
|
||||
ResponseAction::DataAvailable(data) => {
|
||||
let pending_load = self.pending_loads.get_mut(&msg.url).unwrap();
|
||||
pending_load.bytes.push_all(data.as_slice());
|
||||
pending_load.bytes.push_all(&data);
|
||||
}
|
||||
ResponseAction::ResponseComplete(result) => {
|
||||
match result {
|
||||
|
@ -246,7 +246,7 @@ impl ImageCache {
|
|||
let sender = self.decoder_sender.clone();
|
||||
|
||||
self.task_pool.execute(move || {
|
||||
let image = load_from_memory(bytes.as_slice());
|
||||
let image = load_from_memory(&bytes);
|
||||
let msg = DecoderMsg {
|
||||
url: url,
|
||||
image: image
|
||||
|
|
|
@ -28,7 +28,7 @@ impl MIMEClassifier {
|
|||
return self.sniff_unknown_type(!no_sniff, data);
|
||||
}
|
||||
Some((ref media_type, ref media_subtype)) => {
|
||||
match (media_type.as_slice(), media_subtype.as_slice()) {
|
||||
match (&**media_type, &**media_subtype) {
|
||||
("uknown", "unknown") | ("application", "uknown") | ("*", "*") => {
|
||||
return self.sniff_unknown_type(!no_sniff,data);
|
||||
}
|
||||
|
@ -50,14 +50,14 @@ impl MIMEClassifier {
|
|||
.or(supplied_type.clone());
|
||||
}
|
||||
|
||||
if media_type.as_slice() == "image" {
|
||||
if &**media_type == "image" {
|
||||
let tp = self.image_classifier.classify(data);
|
||||
if tp.is_some() {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
|
||||
match (media_type.as_slice(), media_subtype.as_slice()) {
|
||||
match (&**media_type, &**media_subtype) {
|
||||
("audio", _) | ("video", _) | ("application", "ogg") => {
|
||||
let tp = self.audio_video_classifer.classify(data);
|
||||
if tp.is_some() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue