diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-01-01 21:49:19 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-01-02 19:04:18 +0100 |
commit | b51e83819dfc2fded3a10744b353338f75ccae4d (patch) | |
tree | 1edb2c5d81a53ef4e8d5717a2440599d7a3e0f53 /components | |
parent | 141b5d038fad3c0c44a6f1b309b8ca9edea54580 (diff) | |
download | servo-b51e83819dfc2fded3a10744b353338f75ccae4d.tar.gz servo-b51e83819dfc2fded3a10744b353338f75ccae4d.zip |
Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
Diffstat (limited to 'components')
33 files changed, 58 insertions, 58 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 0e5294ae2f3..d8299f2fe4f 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -729,7 +729,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { } fn on_load_url_window_event(&mut self, url_string: String) { - debug!("osmain: loading URL `{:s}`", url_string); + debug!("osmain: loading URL `{}`", url_string); self.got_load_complete_message = false; let root_pipeline_id = match self.scene.root { Some(ref layer) => layer.extra_data.borrow().pipeline.id.clone(), diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 118f33bc3f3..85fb30f77f5 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -762,7 +762,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { fn handle_load_url_msg(&mut self, source_id: PipelineId, load_data: LoadData) { let url = load_data.url.to_string(); - debug!("Constellation: received message to load {:s}", url); + debug!("Constellation: received message to load {}", url); // Make sure no pending page would be overridden. let source_frame = self.current_frame().as_ref().unwrap().find(source_id).expect( "Constellation: received a LoadUrlMsg from a pipeline_id associated diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index 54b59bc8d79..178b840ebce 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -85,7 +85,7 @@ impl ActorRegistry { } pub fn register_script_actor(&self, script_id: String, actor: String) { - println!("registering {:s} ({:s})", actor.as_slice(), script_id.as_slice()); + println!("registering {} ({})", actor.as_slice(), script_id.as_slice()); let mut script_actors = self.script_actors.borrow_mut(); script_actors.insert(script_id, actor); } @@ -103,19 +103,19 @@ impl ActorRegistry { pub fn actor_to_script(&self, actor: String) -> String { for (key, value) in self.script_actors.borrow().iter() { - println!("checking {:s}", value.as_slice()); + println!("checking {}", value.as_slice()); if value.as_slice() == actor.as_slice() { return key.to_string(); } } - panic!("couldn't find actor named {:s}", actor) + panic!("couldn't find actor named {}", actor) } /// Create a unique name based on a monotonically increasing suffix pub fn new_name(&self, prefix: &str) -> String { let suffix = self.next.get(); self.next.set(suffix + 1); - format!("{:s}{:u}", prefix, suffix) + format!("{}{}", prefix, suffix) } /// Add an actor to the registry of known actors that can receive messages. @@ -154,11 +154,11 @@ impl ActorRegistry { -> Result<(), ()> { let to = msg.get(&"to".to_string()).unwrap().as_string().unwrap(); match self.actors.get(&to.to_string()) { - None => println!("message received for unknown actor \"{:s}\"", to), + None => println!("message received for unknown actor \"{}\"", to), Some(actor) => { let msg_type = msg.get(&"type".to_string()).unwrap().as_string().unwrap(); if !try!(actor.handle_message(self, &msg_type.to_string(), msg, stream)) { - println!("unexpected message type \"{:s}\" found for actor \"{:s}\"", + println!("unexpected message type \"{}\" found for actor \"{}\"", msg_type, to); } } diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs index 3e0c934bddb..8839e6f8a34 100644 --- a/components/devtools/actors/console.rs +++ b/components/devtools/actors/console.rs @@ -163,7 +163,7 @@ impl Actor for ConsoleActor { messages.push(json::from_str(json::encode(&message).as_slice()).unwrap().as_object().unwrap().clone());*/ } - s => println!("unrecognized message type requested: \"{:s}\"", s), + s => println!("unrecognized message type requested: \"{}\"", s), } } diff --git a/components/devtools/protocol.rs b/components/devtools/protocol.rs index 52cfdaa3536..e657741b9e3 100644 --- a/components/devtools/protocol.rs +++ b/components/devtools/protocol.rs @@ -16,7 +16,7 @@ pub trait JsonPacketStream { impl JsonPacketStream for TcpStream { fn write_json_packet<'a, T: Encodable<json::Encoder<'a>,IoError>>(&mut self, obj: &T) { let s = json::encode(obj).replace("__type__", "type"); - println!("<- {:s}", s); + println!("<- {}", s); self.write_str(s.len().to_string().as_slice()).unwrap(); self.write_u8(':' as u8).unwrap(); self.write_str(s.as_slice()).unwrap(); @@ -35,7 +35,7 @@ impl JsonPacketStream for TcpStream { let packet_len = num::from_str_radix(packet_len_str.as_slice(), 10).unwrap(); let packet_buf = self.read_exact(packet_len).unwrap(); let packet = String::from_utf8(packet_buf).unwrap(); - println!("{:s}", packet); + println!("{}", packet); return Ok(json::from_str(packet.as_slice()).unwrap()) }, Err(ref e) if e.kind == EndOfFile => diff --git a/components/gfx/font.rs b/components/gfx/font.rs index 8be825f3108..a81c51b4bda 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -185,7 +185,7 @@ impl Font { let result = self.handle.get_table_for_tag(tag); let status = if result.is_some() { "Found" } else { "Didn't find" }; - debug!("{:s} font table[{:s}] with family={}, face={}", + debug!("{} font table[{}] with family={}, face={}", status, tag.tag_to_str(), self.handle.family_name(), self.handle.face_name()); diff --git a/components/gfx/font_cache_task.rs b/components/gfx/font_cache_task.rs index a7bc98424ca..0b1ba4c9083 100644 --- a/components/gfx/font_cache_task.rs +++ b/components/gfx/font_cache_task.rs @@ -181,7 +181,7 @@ impl FontCache { // TODO(Issue #188): look up localized font family names if canonical name not found // look up canonical name if self.local_families.contains_key(family_name) { - debug!("FontList: Found font family with name={:s}", family_name.as_slice()); + debug!("FontList: Found font family with name={}", family_name.as_slice()); let s = &mut self.local_families[*family_name]; if s.templates.len() == 0 { @@ -199,7 +199,7 @@ impl FontCache { None } else { - debug!("FontList: Couldn't find font family with name={:s}", family_name.as_slice()); + debug!("FontList: Couldn't find font family with name={}", family_name.as_slice()); None } } diff --git a/components/gfx/platform/macos/font_list.rs b/components/gfx/platform/macos/font_list.rs index da0485713f8..4a10b0ee463 100644 --- a/components/gfx/platform/macos/font_list.rs +++ b/components/gfx/platform/macos/font_list.rs @@ -19,7 +19,7 @@ pub fn get_available_families(callback: |String|) { } pub fn get_variations_for_family(family_name: &str, callback: |String|) { - debug!("Looking for faces of family: {:s}", family_name); + debug!("Looking for faces of family: {}", family_name); let family_collection = core_text::font_collection::create_for_family(family_name.as_slice()); diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index d510126e7fd..4cf0575dbee 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -304,7 +304,7 @@ impl Shaper { debug!("{} -> {}", i, loc); } - debug!("text: {:s}", text); + debug!("text: {}", text); debug!("(char idx): char->(glyph index):"); for (i, ch) in text.char_indices() { debug!("{}: {} --> {:d}", i, ch, *byte_to_glyph.get(i).unwrap() as int); diff --git a/components/layout/inline.rs b/components/layout/inline.rs index fdea1dcdcfa..2230fb3e823 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -1237,7 +1237,7 @@ impl Flow for InlineFlow { fn build_display_list(&mut self, layout_context: &LayoutContext) { // TODO(#228): Once we form lines and have their cached bounds, we can be smarter and // not recurse on a line if nothing in it can intersect the dirty region. - debug!("Flow: building display list for {:u} inline fragments", self.fragments.len()); + debug!("Flow: building display list for {} inline fragments", self.fragments.len()); let mut display_list = box DisplayList::new(); for fragment in self.fragments.fragments.iter_mut() { diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 2eeeb31409f..3082d20924c 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -715,7 +715,7 @@ impl LayoutTask { mem::transmute(&mut node) }; - debug!("layout: received layout request for: {:s}", data.url.serialize()); + debug!("layout: received layout request for: {}", data.url.serialize()); debug!("layout: parsed Node tree"); if log_enabled!(log::DEBUG) { node.dump(); diff --git a/components/layout/text.rs b/components/layout/text.rs index ab53aa9a7f9..ea79541bde0 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -41,7 +41,7 @@ impl TextRunScanner { pub fn scan_for_runs(&mut self, font_context: &mut FontContext, mut fragments: DList<Fragment>) -> InlineFragments { - debug!("TextRunScanner: scanning {:u} fragments for text runs...", fragments.len()); + debug!("TextRunScanner: scanning {} fragments for text runs...", fragments.len()); // FIXME(pcwalton): We want to be sure not to allocate multiple times, since this is a // performance-critical spot, but this may overestimate and allocate too much memory. diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 448b4c9e6c9..3d1b2ba69ff 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -219,7 +219,7 @@ impl<'ln> LayoutNode<'ln> { } s.push_str(self.debug_str().as_slice()); - println!("{:s}", s); + println!("{}", s); for kid in self.children() { kid.dump_indent(indent + 1); diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 7dde743a936..2c523209203 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -62,13 +62,13 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) { match url.scheme.as_slice() { "http" | "https" => {} _ => { - let s = format!("{:s} request, but we don't support that scheme", url.scheme); + let s = format!("{} request, but we don't support that scheme", url.scheme); send_error(url, s, senders); return; } } - info!("requesting {:s}", url.serialize()); + info!("requesting {}", url.serialize()); let mut req = match Request::new(load_data.method.clone(), url.clone()) { Ok(req) => req, diff --git a/components/net/image/holder.rs b/components/net/image/holder.rs index 514b6c22135..2ca86d8af99 100644 --- a/components/net/image/holder.rs +++ b/components/net/image/holder.rs @@ -87,8 +87,8 @@ impl<NodeAddress: Send> ImageHolder<NodeAddress> { }; match port.recv() { ImageResponseMsg::ImageReady(image) => self.image = Some(image), - ImageResponseMsg::ImageNotReady => debug!("image not ready for {:s}", self.url.serialize()), - ImageResponseMsg::ImageFailed => debug!("image decoding failed for {:s}", self.url.serialize()), + ImageResponseMsg::ImageNotReady => debug!("image not ready for {}", self.url.serialize()), + ImageResponseMsg::ImageFailed => debug!("image decoding failed for {}", self.url.serialize()), } } diff --git a/components/net/image_cache_task.rs b/components/net/image_cache_task.rs index 0f90bc6a156..0d202a78d3e 100644 --- a/components/net/image_cache_task.rs +++ b/components/net/image_cache_task.rs @@ -251,11 +251,11 @@ impl ImageCache { spawn_named("ImageCacheTask (prefetch)", proc() { let url = url_clone; - debug!("image_cache_task: started fetch for {:s}", url.serialize()); + debug!("image_cache_task: started fetch for {}", url.serialize()); let image = load_image_data(url.clone(), resource_task.clone()); to_cache.send(Msg::StorePrefetchedImageData(url.clone(), image)); - debug!("image_cache_task: ended fetch for {:s}", url.serialize()); + debug!("image_cache_task: ended fetch for {}", url.serialize()); }); self.set_state(url, ImageState::Prefetching(AfterPrefetch::DoNotDecode)); @@ -315,11 +315,11 @@ impl ImageCache { self.task_pool.execute(proc() { let url = url_clone; - debug!("image_cache_task: started image decode for {:s}", url.serialize()); + debug!("image_cache_task: started image decode for {}", url.serialize()); let image = load_from_memory(data.as_slice()); let image = image.map(|image| Arc::new(box image)); to_cache.send(Msg::StoreImage(url.clone(), image)); - debug!("image_cache_task: ended image decode for {:s}", url.serialize()); + debug!("image_cache_task: ended image decode for {}", url.serialize()); }); self.set_state(url, ImageState::Decoding); diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs index 20d40205dd2..23cb90f38be 100644 --- a/components/net/resource_task.rs +++ b/components/net/resource_task.rs @@ -234,13 +234,13 @@ impl ResourceManager { "data" => data_loader::factory, "about" => about_loader::factory, _ => { - debug!("resource_task: no loader for scheme {:s}", load_data.url.scheme); + debug!("resource_task: no loader for scheme {}", load_data.url.scheme); start_sending(senders, Metadata::default(load_data.url)) .send(ProgressMsg::Done(Err("no loader for scheme".to_string()))); return } }; - debug!("resource_task: loading url: {:s}", load_data.url.serialize()); + debug!("resource_task: loading url: {}", load_data.url.serialize()); loader(load_data, self.sniffer_task.clone()); } diff --git a/components/script/devtools.rs b/components/script/devtools.rs index c2f0957f9ec..ed03130397a 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.rs @@ -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>>) { diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 955638a7f7d..5299360adb7 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -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); } } diff --git a/components/script/dom/console.rs b/components/script/dom/console.rs index 585878e528c..924a2bb1cbe 100644 --- a/components/script/dom/console.rs +++ b/components/script/dom/console.rs @@ -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); } } } diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 77de0380c98..e8f7398d545 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -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() }, diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index f5c83f85783..53c9dd08add 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -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); diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index 78eee6afb5f..2b842d6c20a 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -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) } } } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index fdcd8d474de..b760cce0994 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -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 => { diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 45bcc2a8ce6..85a5122c942 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -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() { diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 7b7cc679461..5f4517aff3f 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -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) { diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 24cafc44e82..b509128230b 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -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()]); diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index eb97d0893a4..a650895e4c3 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -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, } diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 918d776c59f..3e482435888 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -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() { diff --git a/components/style/errors.rs b/components/style/errors.rs index ae0df3797e9..1f238aeca4e 100644 --- a/components/style/errors.rs +++ b/components/style/errors.rs @@ -28,5 +28,5 @@ impl<T, I: Iterator<Result<T, SyntaxError>>> Iterator<T> for ErrorLoggerIterator /// to log CSS parse errors to stderr. pub fn log_css_error(location: SourceLocation, message: &str) { // TODO eventually this will got into a "web console" or something. - info!("{:u}:{:u} {:s}", location.line, location.column, message) + info!("{}:{} {}", location.line, location.column, message) } diff --git a/components/style/font_face.rs b/components/style/font_face.rs index 2519b30c32b..d724a190880 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -68,7 +68,7 @@ pub fn parse_font_face_rule(rule: AtRule, parent_rules: &mut Vec<CSSRule>, base_ for item in ErrorLoggerIterator(parse_declaration_list(block.into_iter())) { match item { DeclarationListItem::AtRule(rule) => log_css_error( - rule.location, format!("Unsupported at-rule in declaration list: @{:s}", rule.name).as_slice()), + rule.location, format!("Unsupported at-rule in declaration list: @{}", rule.name).as_slice()), DeclarationListItem::Declaration(Declaration{ location, name, value, important }) => { if important { log_css_error(location, "!important is not allowed on @font-face descriptors"); @@ -94,7 +94,7 @@ pub fn parse_font_face_rule(rule: AtRule, parent_rules: &mut Vec<CSSRule>, base_ }; }, _ => { - log_css_error(location, format!("Unsupported declaration {:s}", name).as_slice()); + log_css_error(location, format!("Unsupported declaration {}", name).as_slice()); } } } diff --git a/components/style/properties/mod.rs.mako b/components/style/properties/mod.rs.mako index 68d4fabd46c..6ae7c658d3a 100644 --- a/components/style/properties/mod.rs.mako +++ b/components/style/properties/mod.rs.mako @@ -2420,7 +2420,7 @@ pub fn parse_property_declaration_list<I: Iterator<Node>>(input: I, base_url: &U for item in items.into_iter().rev() { match item { DeclarationListItem::AtRule(rule) => log_css_error( - rule.location, format!("Unsupported at-rule in declaration list: @{:s}", rule.name).as_slice()), + rule.location, format!("Unsupported at-rule in declaration list: @{}", rule.name).as_slice()), DeclarationListItem::Declaration(Declaration{ location: l, name: n, value: v, important: i}) => { // TODO: only keep the last valid declaration for a given name. let (list, seen) = if i { diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index 454f4cb5052..71eb15cc1e2 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -153,7 +153,7 @@ pub fn parse_nested_at_rule(context: &ParserContext, } "font-face" => parse_font_face_rule(rule, parent_rules, base_url), _ => log_css_error(rule.location, - format!("Unsupported at-rule: @{:s}", lower_name).as_slice()) + format!("Unsupported at-rule: @{}", lower_name).as_slice()) } } |