275275 html_root_url = "http://doc.rust-lang.org/nightly/" ) ]
276276#![ feature( int_uint) ]
277277#![ feature( collections) ]
278- #![ feature( core) ]
279278#![ feature( old_io) ]
280279
281280use self :: LabelText :: * ;
282281
283- use std:: borrow:: IntoCow ;
282+ use std:: borrow:: { IntoCow , Cow } ;
284283use std:: old_io;
285- use std:: string:: CowString ;
286- use std:: vec:: CowVec ;
287284
288285/// The text for a graphviz label on a node or edge.
289286pub enum LabelText < ' a > {
290287 /// This kind of label preserves the text directly as is.
291288 ///
292289 /// Occurrences of backslashes (`\`) are escaped, and thus appear
293290 /// as backslashes in the rendered label.
294- LabelStr ( CowString < ' a > ) ,
291+ LabelStr ( Cow < ' a , str > ) ,
295292
296293 /// This kind of label uses the graphviz label escString type:
297294 /// http://www.graphviz.org/content/attrs#kescString
@@ -303,7 +300,7 @@ pub enum LabelText<'a> {
303300 /// to break a line (centering the line preceding the `\n`), there
304301 /// are also the escape sequences `\l` which left-justifies the
305302 /// preceding line and `\r` which right-justifies it.
306- EscStr ( CowString < ' a > ) ,
303+ EscStr ( Cow < ' a , str > ) ,
307304}
308305
309306// There is a tension in the design of the labelling API.
@@ -340,7 +337,7 @@ pub enum LabelText<'a> {
340337
341338/// `Id` is a Graphviz `ID`.
342339pub struct Id < ' a > {
343- name : CowString < ' a > ,
340+ name : Cow < ' a , str > ,
344341}
345342
346343impl < ' a > Id < ' a > {
@@ -387,7 +384,7 @@ impl<'a> Id<'a> {
387384 & * self . name
388385 }
389386
390- pub fn name ( self ) -> CowString < ' a > {
387+ pub fn name ( self ) -> Cow < ' a , str > {
391388 self . name
392389 }
393390}
@@ -463,7 +460,7 @@ impl<'a> LabelText<'a> {
463460 /// yields same content as self. The result obeys the law
464461 /// render(`lt`) == render(`EscStr(lt.pre_escaped_content())`) for
465462 /// all `lt: LabelText`.
466- fn pre_escaped_content ( self ) -> CowString < ' a > {
463+ fn pre_escaped_content ( self ) -> Cow < ' a , str > {
467464 match self {
468465 EscStr ( s) => s,
469466 LabelStr ( s) => if s. contains_char ( '\\' ) {
@@ -489,8 +486,8 @@ impl<'a> LabelText<'a> {
489486 }
490487}
491488
492- pub type Nodes < ' a , N > = CowVec < ' a , N > ;
493- pub type Edges < ' a , E > = CowVec < ' a , E > ;
489+ pub type Nodes < ' a , N > = Cow < ' a , [ N ] > ;
490+ pub type Edges < ' a , E > = Cow < ' a , [ E ] > ;
494491
495492// (The type parameters in GraphWalk should be associated items,
496493// when/if Rust supports such.)
0 commit comments