mirror of
https://github.com/servo/servo.git
synced 2025-06-12 18:34:39 +00: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
|
@ -77,7 +77,7 @@ fn find_node_by_unique_id(page: &Rc<Page>, pipeline: PipelineId, node_id: String
|
|||
}
|
||||
}
|
||||
|
||||
panic!("couldn't find node with unique id {:s}", node_id)
|
||||
panic!("couldn't find node with unique id {}", node_id)
|
||||
}
|
||||
|
||||
pub fn handle_get_children(page: &Rc<Page>, pipeline: PipelineId, node_id: String, reply: Sender<Vec<NodeInfo>>) {
|
||||
|
|
|
@ -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()]);
|
||||
|
|
|
@ -111,7 +111,7 @@ impl<'a> TreeSink<TrustedNodeAddress> for servohtmlparser::Sink {
|
|||
}
|
||||
|
||||
fn parse_error(&mut self, msg: MaybeOwned<'static>) {
|
||||
debug!("Parse error: {:s}", msg);
|
||||
debug!("Parse error: {}", msg);
|
||||
}
|
||||
|
||||
fn set_quirks_mode(&mut self, mode: QuirksMode) {
|
||||
|
@ -180,7 +180,7 @@ pub fn parse_html(document: JSRef<Document>,
|
|||
HTMLInput::InputUrl(load_response) => {
|
||||
match load_response.metadata.content_type {
|
||||
Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case("image") => {
|
||||
let page = format!("<html><body><img src='{:s}' /></body></html>", url.serialize());
|
||||
let page = format!("<html><body><img src='{}' /></body></html>", url.serialize());
|
||||
parser.parse_chunk(page);
|
||||
},
|
||||
_ => {
|
||||
|
@ -192,7 +192,7 @@ pub fn parse_html(document: JSRef<Document>,
|
|||
parser.parse_chunk(data);
|
||||
}
|
||||
Done(Err(err)) => {
|
||||
panic!("Failed to load page URL {:s}, error: {:s}", url.serialize(), err);
|
||||
panic!("Failed to load page URL {}, error: {}", url.serialize(), err);
|
||||
}
|
||||
Done(Ok(())) => break,
|
||||
}
|
||||
|
|
|
@ -1139,7 +1139,7 @@ impl ScriptTask {
|
|||
match maybe_node {
|
||||
Some(el) => {
|
||||
let node = NodeCast::from_ref(el);
|
||||
debug!("clicked on {:s}", node.debug_str());
|
||||
debug!("clicked on {}", node.debug_str());
|
||||
// Prevent click event if form control element is disabled.
|
||||
if node.click_event_filter_by_disabled_state() { return; }
|
||||
match *page.frame() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue