oli-obk / rust-pandoc

Apache License 2.0
51 stars 29 forks source link

Filters: Support closures for filtering #27

Closed kinnison closed 4 years ago

kinnison commented 4 years ago

In order to support somewhat more complex filtering cases, while working on a project we encountered the need for closures rather than simply filter functions. This change is the simplest possible which permits the use of 'static + Fn(String) -> String closures to increase flexibility.

The internal use of Rc means that we swap from Send + Sync on the Pandoc struct to !Send + !Sync -- I can swap that to Arc if the change is unacceptable, otherwise this is also a breaking change.

oli-obk commented 4 years ago

We can always move to Arc when someone asks for it. Or we remove the clone bound and use boxes