[HTTP] Remove unnecessary clones by passing around owned data
A lot of the methods on Request and AttachmentType were only given references or mutable references to their data, instead of taking owned data. This was unnecessary and caused a lot of cloning. This PR fixes this
Looking at the tests that failed, they are related to the AttachmentType From impl changing, but taking a second look it seems to be quite ambiguous anyway, should I remove these conversions and make it explicit for the user?
Clean diff here: https://github.com/serenity-rs/serenity/compare/5edbf0b3a720c528394a5d88325cb2ec804ae31b...GnomedDev:serenity:cleanup-http
Currently blocked on @GnomedDev reviewing https://github.com/GnomedDev/serenity/pull/1 I believe?
Sorry for the close and reopen, was accidental.
I've just removed most of the public AttachmentType changes, apart from changing the Cow<'a, [u8]> to Vec<u8> as previously it was useless (but the From implementation still uses Cow, someone else can bikeshed them).
There is harm, it is misleading currently as if it is passed through it goes into impl Into<Cow<'static, [u8]>> which means that the Cow is useless as-is.
Not sure what you mean, could you give an example?
@GnomedDev now that #2163 has been merged, could you rebase this on top and remove the attachments changes?