mirror of
https://github.com/servo/servo.git
synced 2025-07-29 02:00:23 +01:00
Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
This commit is contained in:
parent
141b5d038f
commit
b51e83819d
35 changed files with 63 additions and 63 deletions
|
@ -87,7 +87,7 @@ pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: JSVal) {
|
|||
(*tracer).debugPrinter = None;
|
||||
(*tracer).debugPrintIndex = -1;
|
||||
(*tracer).debugPrintArg = name.as_ptr() as *const libc::c_void;
|
||||
debug!("tracing value {:s}", description);
|
||||
debug!("tracing value {}", description);
|
||||
JS_CallTracer(tracer, val.to_gcthing(), val.trace_kind());
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ pub fn trace_object(tracer: *mut JSTracer, description: &str, obj: *mut JSObject
|
|||
(*tracer).debugPrinter = None;
|
||||
(*tracer).debugPrintIndex = -1;
|
||||
(*tracer).debugPrintArg = name.as_ptr() as *const libc::c_void;
|
||||
debug!("tracing {:s}", description);
|
||||
debug!("tracing {}", description);
|
||||
JS_CallTracer(tracer, obj as *mut libc::c_void, JSTRACE_OBJECT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,23 +28,23 @@ impl Console {
|
|||
|
||||
impl<'a> ConsoleMethods for JSRef<'a, Console> {
|
||||
fn Log(self, message: DOMString) {
|
||||
println!("{:s}", message);
|
||||
println!("{}", message);
|
||||
}
|
||||
|
||||
fn Debug(self, message: DOMString) {
|
||||
println!("{:s}", message);
|
||||
println!("{}", message);
|
||||
}
|
||||
|
||||
fn Info(self, message: DOMString) {
|
||||
println!("{:s}", message);
|
||||
println!("{}", message);
|
||||
}
|
||||
|
||||
fn Warn(self, message: DOMString) {
|
||||
println!("{:s}", message);
|
||||
println!("{}", message);
|
||||
}
|
||||
|
||||
fn Error(self, message: DOMString) {
|
||||
println!("{:s}", message);
|
||||
println!("{}", message);
|
||||
}
|
||||
|
||||
fn Assert(self, condition: bool, message: Option<DOMString>) {
|
||||
|
@ -53,7 +53,7 @@ impl<'a> ConsoleMethods for JSRef<'a, Console> {
|
|||
Some(ref message) => message.as_slice(),
|
||||
None => "no message",
|
||||
};
|
||||
println!("Assertion failed: {:s}", message);
|
||||
println!("Assertion failed: {}", message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -685,7 +685,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
|
|||
let name = match prefix {
|
||||
None => qname.local.clone(),
|
||||
Some(ref prefix) => {
|
||||
let name = format!("{:s}:{:s}", *prefix, qname.local.as_slice());
|
||||
let name = format!("{}:{}", *prefix, qname.local.as_slice());
|
||||
Atom::from_slice(name.as_slice())
|
||||
},
|
||||
};
|
||||
|
@ -905,7 +905,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
|||
fn TagName(self) -> DOMString {
|
||||
let qualified_name = match self.prefix {
|
||||
Some(ref prefix) => {
|
||||
(format!("{:s}:{:s}",
|
||||
(format!("{}:{}",
|
||||
prefix.as_slice(),
|
||||
self.local_name.as_slice())).into_maybe_owned()
|
||||
},
|
||||
|
|
|
@ -63,7 +63,7 @@ impl<'a> PrivateHTMLAnchorElementHelpers for JSRef<'a, HTMLAnchorElement> {
|
|||
match attr {
|
||||
Some(ref href) => {
|
||||
let value = href.r().Value();
|
||||
debug!("clicked on link to {:s}", value);
|
||||
debug!("clicked on link to {}", value);
|
||||
let node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
let doc = node.owner_doc().root();
|
||||
doc.r().load_anchor_href(value);
|
||||
|
|
|
@ -133,7 +133,7 @@ impl<'a> PrivateHTMLLinkElementHelpers for JSRef<'a, HTMLLinkElement> {
|
|||
let LayoutChan(ref layout_chan) = window.page().layout_chan;
|
||||
layout_chan.send(Msg::LoadStylesheet(url));
|
||||
}
|
||||
Err(e) => debug!("Parsing url {:s} failed: {}", href, e)
|
||||
Err(e) => debug!("Parsing url {} failed: {}", href, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
|
|||
true
|
||||
},
|
||||
Some(ref s) => {
|
||||
debug!("script type={:s}", *s);
|
||||
debug!("script type={}", *s);
|
||||
SCRIPT_JS_MIMES.contains(&s.to_ascii_lower().as_slice().trim_chars(HTML_SPACE_CHARACTERS))
|
||||
},
|
||||
None => {
|
||||
|
@ -241,7 +241,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
|
|||
true
|
||||
},
|
||||
Some(ref s) => {
|
||||
debug!("script language={:s}", *s);
|
||||
debug!("script language={}", *s);
|
||||
SCRIPT_JS_MIMES.contains(&format!("text/{}", s).to_ascii_lower().as_slice())
|
||||
},
|
||||
None => {
|
||||
|
|
|
@ -495,7 +495,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
|
|||
}
|
||||
|
||||
s.push_str(self.debug_str().as_slice());
|
||||
debug!("{:s}", s);
|
||||
debug!("{}", s);
|
||||
|
||||
// FIXME: this should have a pure version?
|
||||
for kid in self.children() {
|
||||
|
|
|
@ -185,7 +185,7 @@ pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
|
|||
impl<'a> WindowMethods for JSRef<'a, Window> {
|
||||
fn Alert(self, s: DOMString) {
|
||||
// Right now, just print to the console
|
||||
println!("ALERT: {:s}", s);
|
||||
println!("ALERT: {}", s);
|
||||
}
|
||||
|
||||
fn Close(self) {
|
||||
|
@ -273,7 +273,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
|
|||
}
|
||||
|
||||
fn Debug(self, message: DOMString) {
|
||||
debug!("{:s}", message);
|
||||
debug!("{}", message);
|
||||
}
|
||||
|
||||
fn Gc(self) {
|
||||
|
|
|
@ -595,7 +595,7 @@ 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!("{:u}", p).as_slice());
|
||||
buf.push_str(format!("{}", p).as_slice());
|
||||
});
|
||||
referer_url.serialize_path().map(|ref h| buf.push_str(h.as_slice()));
|
||||
self.request_headers.borrow_mut().set_raw("Referer".into_string(), vec![buf.into_bytes()]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue