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

Split utils into submods #231

Merged
merged 2 commits into from
Jul 28, 2018
Merged

Split utils into submods #231

merged 2 commits into from
Jul 28, 2018

Conversation

csmoe
Copy link
Member

@csmoe csmoe commented Jul 27, 2018

Closes #229

Copy link
Member

@ashleygwilliams ashleygwilliams left a comment

Choose a reason for hiding this comment

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

this is a great start! thanks so much. jus a few things... let's rename tests/all/utils/readme.rs to tests/all/utils/file.rs and let's pull the fixture stuff out of mod.rs into fixture.rs - this way mod.rs doesn't have anything but the reexports :)

@ashleygwilliams ashleygwilliams merged commit 425aefb into rustwasm:master Jul 28, 2018
@@ -47,7 +47,7 @@ fn it_creates_a_package_json_provided_path() {
assert!(fs::metadata(&crate_readme_path).is_ok());
assert!(fs::metadata(&pkg_readme_path).is_ok());

let crate_readme = utils::readme::read_file(&crate_readme_path).unwrap();
let pkg_readme = utils::readme::read_file(&pkg_readme_path).unwrap();
let crate_readme = utils::file::read_file(&crate_readme_path).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit late now, but std has a convenience function that does this now called:

std::fs::read_to_string and for bytes std::fs::read!

One of my favorite new additions to the standard library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants