diff options
| author | Zeyla Hellyer <[email protected]> | 2018-07-04 21:28:22 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-07-04 21:32:17 -0700 |
| commit | 7b9764cf1097b0620d871fabe67b5593f0cd4a4a (patch) | |
| tree | 5b9f3eac6e9c57ac255c73bd1eea07669838f32d /src/model/invite.rs | |
| parent | Fix dead doc-links and add missing ones. (#347) (diff) | |
| download | serenity-7b9764cf1097b0620d871fabe67b5593f0cd4a4a.tar.xz serenity-7b9764cf1097b0620d871fabe67b5593f0cd4a4a.zip | |
Monomorphize all functions
This commit monomorphizes all functions, turning functions like:
```rust
fn foo<T: Into<Bar>>(baz: T) {
baz = baz.into();
// function here
}
```
Into functions like:
```rust
fn foo<T: Into<Bar>>(baz: T) {
_foo(baz.into())
}
fn _foo(baz: Bar) {
// function here
}
```
This avoids binary bloat and improves build times, by reducing the amount of
code duplication.
Diffstat (limited to 'src/model/invite.rs')
| -rw-r--r-- | src/model/invite.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/model/invite.rs b/src/model/invite.rs index b93b231..2bbd5d9 100644 --- a/src/model/invite.rs +++ b/src/model/invite.rs @@ -70,8 +70,11 @@ impl Invite { /// [permission]: permissions/index.html pub fn create<C, F>(channel_id: C, f: F) -> Result<RichInvite> where C: Into<ChannelId>, F: FnOnce(CreateInvite) -> CreateInvite { - let channel_id = channel_id.into(); + Self::_create(channel_id.into(), f) + } + fn _create<F>(channel_id: ChannelId, f: F) -> Result<RichInvite> + where F: FnOnce(CreateInvite) -> CreateInvite { #[cfg(feature = "cache")] { let req = Permissions::CREATE_INVITE; |