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

implement split filter #44

Merged
merged 1 commit into from
Jun 15, 2016
Merged

implement split filter #44

merged 1 commit into from
Jun 15, 2016

Conversation

bacoboy
Copy link

@bacoboy bacoboy commented Jun 14, 2016

One of the tests is commented out pending fix for comma/space issue: #41

Otherwise, I think this works based on the other test case I included.

Should probably update #11 as well.

@johannhof
Copy link
Contributor

Can you rebase and try running your test again? :)

@bacoboy
Copy link
Author

bacoboy commented Jun 15, 2016

👍 Looks good. Just waiting on automated tests.

Pls let me know if you are going to cut a release with all these recent fixes! Thx!

// The split string argument is also in fact a String
let v: Vec<&str> = string_to_split.split(split_string).collect();
// Split and construct result
Ok(Array(v.iter().map(|x| Str(String::from(*x))).collect()))
Copy link
Contributor

Choose a reason for hiding this comment

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

you're calling .collect() and immediately afterwards .iter(). I think you can simply remove both these calls.

Copy link
Author

Choose a reason for hiding this comment

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

OK I think I got it figured out in 1 line... Watch for new commit.

@johannhof
Copy link
Contributor

Looks good, but can you please install rustfmt and run cargo fmt over the project? You have some pretty long lines there, it would be great to split them up.

@bacoboy
Copy link
Author

bacoboy commented Jun 15, 2016

Still getting some that aren't mine, but repushed the branch with changes

% cargo fmt
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/lib.rs:127: line exceeded maximum length (sorry)
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/lib.rs:132: line exceeded maximum length (sorry)
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/tags/for_block.rs:86: line exceeded maximum length (sorry)
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/tags/for_block.rs:93: line exceeded maximum length (sorry)
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/tags/for_block.rs:419: line exceeded maximum length (sorry)
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/tags/for_block.rs:420: line exceeded maximum length (sorry)
Rustfmt failed at /Users/shoffman/workspace/liquid-rust/src/tags/for_block.rs:421: line exceeded maximum length (sorry)

@johannhof
Copy link
Contributor

Great 👍

@johannhof johannhof merged commit b8946a9 into cobalt-org:master Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants