mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Stop abusing format! macro when construct a String
In these cases for `format!`, we're just constructing a String of the single argument with no special format.
This commit is contained in:
parent
445f1c891a
commit
5a780cb221
5 changed files with 7 additions and 7 deletions
|
@ -1090,7 +1090,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
|||
fn LastModified(self) -> DOMString {
|
||||
match self.last_modified {
|
||||
Some(ref t) => t.clone(),
|
||||
None => format!("{}", time::now().strftime("%m/%d/%Y %H:%M:%S").unwrap()),
|
||||
None => time::now().strftime("%m/%d/%Y %H:%M:%S").unwrap().to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -616,13 +616,13 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
|
|||
referer_url.serialize_host().map(|ref h| buf.push_str(h.as_slice()));
|
||||
referer_url.port().as_ref().map(|&p| {
|
||||
buf.push_str(":".as_slice());
|
||||
buf.push_str(format!("{}", p).as_slice());
|
||||
buf.push_str(p.to_string().as_slice());
|
||||
});
|
||||
referer_url.serialize_path().map(|ref h| buf.push_str(h.as_slice()));
|
||||
self.request_headers.borrow_mut().set_raw("Referer".to_owned(), vec![buf.into_bytes()]);
|
||||
},
|
||||
Ok(Some(ref req)) => self.insert_trusted_header("origin".to_owned(),
|
||||
format!("{}", req.origin)),
|
||||
req.origin.to_string()),
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue