-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add library crate #195
Add library crate #195
Conversation
src/lib.rs
Outdated
/// ..ReplaceConf::default() | ||
/// }) | ||
/// ``` | ||
pub fn replace(find: String, replace_with: String, replace_conf: ReplaceConf) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you! One thing I'm wondering, though, is it possible to use &str
instead of String
as the type for find
and replace_with
? Otherwise, we would always have to create and move String
s. In the current implementation, for example, replace("foo", "bar", ...)
is not possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
Since this is building off of #193 I'm going to put this on the backburner milestone as well |
Add config builder, test and support `&str` argument.
Alright the release is out, so I'm back to revisiting this. I posted more of my updated thoughts here (#194 (comment)), but the gist is that too many things are currently changing and more stuff is likely to change in the future within Thanks for your contribution nevertheless, and sorry for changing my mind on this 🙇 |
This PR is based on #193. So do not merge me before when #193 is merged, please.
This PR is going to solve #194. It supports users can:
Maybe using a builder is a great idea? And I also need more tests for it.
Your advice is important to me, @CosmicHorrorDev and @fujidaiti. What do you think?