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/channel/embed.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/channel/embed.rs')
| -rw-r--r-- | src/model/channel/embed.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/model/channel/embed.rs b/src/model/channel/embed.rs index 8837a8d..bc2d0da 100644 --- a/src/model/channel/embed.rs +++ b/src/model/channel/embed.rs @@ -134,9 +134,13 @@ impl EmbedField { /// [`value`]: #structfield.value pub fn new<T, U>(name: T, value: U, inline: bool) -> Self where T: Into<String>, U: Into<String> { + Self::_new(name.into(), value.into(), inline) + } + + fn _new(name: String, value: String, inline: bool) -> Self { Self { - name: name.into(), - value: value.into(), + name: name, + value: value, inline, } } |