Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup for libgraphviz #46784

Merged
merged 1 commit into from
Dec 22, 2017
Merged

Cleanup for libgraphviz #46784

merged 1 commit into from
Dec 22, 2017

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Dec 17, 2017

No description provided.

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

text.push("[shape=");
text.push(&shape);
text.push("]");
write!(text, "[shape={}]", &s.to_dot_string());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ?

}

text.push(";");
writeln(w, &text)?;
write!(text, ";");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ?

let source = g.source(e);
let target = g.target(e);
let source_id = g.node_id(&source);
let target_id = g.node_id(&target);

let mut text = vec![source_id.as_slice(), " -> ", target_id.as_slice()];
let mut text = ::std::io::Cursor::new(Vec::new());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are cursors necessary? Can't you write to vecs directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know you could write to them without cursor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nor did i!

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 17, 2017
@bjorn3
Copy link
Member Author

bjorn3 commented Dec 17, 2017

As it can't fail. (Its on the Vec, not the W)

text.push(";");
writeln(w, &text)?;
write!(text, ";").unwrap();
w.write_all(&text[..])?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes a newline, which breaks some tests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm now. Can you just squash the commits into one?

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 18, 2017

Rebased

for n in g.nodes().iter() {
indent(w)?;
write!(w, " ")?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(personally I usually prefer a function like indent over having to double-check that the string contents all match up, but since there are only two calls to indent I'm not going to make a fuss)

@pnkfelix
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 21, 2017

📌 Commit 2e2defd has been approved by pnkfelix

@pnkfelix pnkfelix added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 21, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Dec 21, 2017
bors added a commit that referenced this pull request Dec 21, 2017
Rollup of 14 pull requests

- Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918
- Failed merges:
@bors bors merged commit 2e2defd into rust-lang:master Dec 22, 2017
@bjorn3 bjorn3 deleted the patch-1 branch December 22, 2017 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants