Skip to content

Commit 1540e8c

Browse files
committed
Remove inline attribute on generic functions
1 parent bc900f5 commit 1540e8c

File tree

2 files changed

+18
-138
lines changed

2 files changed

+18
-138
lines changed

src/libserialize/collection_impls.rs

+15-33
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ use std::collections::{LinkedList, VecDeque, BTreeMap, BTreeSet, HashMap, HashSe
1717
use std::rc::Rc;
1818
use std::sync::Arc;
1919

20-
impl<
21-
T: Encodable
22-
> Encodable for LinkedList<T> {
23-
#[inline]
20+
impl<T: Encodable> Encodable for LinkedList<T> {
2421
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
2522
s.emit_seq(self.len(), |s| {
2623
for (i, e) in self.iter().enumerate() {
@@ -32,7 +29,6 @@ impl<
3229
}
3330

3431
impl<T:Decodable> Decodable for LinkedList<T> {
35-
#[inline]
3632
fn decode<D: Decoder>(d: &mut D) -> Result<LinkedList<T>, D::Error> {
3733
d.read_seq(|d, len| {
3834
let mut list = LinkedList::new();
@@ -45,7 +41,6 @@ impl<T:Decodable> Decodable for LinkedList<T> {
4541
}
4642

4743
impl<T: Encodable> Encodable for VecDeque<T> {
48-
#[inline]
4944
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
5045
s.emit_seq(self.len(), |s| {
5146
for (i, e) in self.iter().enumerate() {
@@ -57,7 +52,6 @@ impl<T: Encodable> Encodable for VecDeque<T> {
5752
}
5853

5954
impl<T:Decodable> Decodable for VecDeque<T> {
60-
#[inline]
6155
fn decode<D: Decoder>(d: &mut D) -> Result<VecDeque<T>, D::Error> {
6256
d.read_seq(|d, len| {
6357
let mut deque: VecDeque<T> = VecDeque::new();
@@ -69,11 +63,10 @@ impl<T:Decodable> Decodable for VecDeque<T> {
6963
}
7064
}
7165

72-
impl<
73-
K: Encodable + PartialEq + Ord,
74-
V: Encodable
75-
> Encodable for BTreeMap<K, V> {
76-
#[inline]
66+
impl<K, V> Encodable for BTreeMap<K, V>
67+
where K: Encodable + PartialEq + Ord,
68+
V: Encodable
69+
{
7770
fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> {
7871
e.emit_map(self.len(), |e| {
7972
let mut i = 0;
@@ -87,11 +80,10 @@ impl<
8780
}
8881
}
8982

90-
impl<
91-
K: Decodable + PartialEq + Ord,
92-
V: Decodable
93-
> Decodable for BTreeMap<K, V> {
94-
#[inline]
83+
impl<K, V> Decodable for BTreeMap<K, V>
84+
where K: Decodable + PartialEq + Ord,
85+
V: Decodable
86+
{
9587
fn decode<D: Decoder>(d: &mut D) -> Result<BTreeMap<K, V>, D::Error> {
9688
d.read_map(|d, len| {
9789
let mut map = BTreeMap::new();
@@ -105,10 +97,9 @@ impl<
10597
}
10698
}
10799

108-
impl<
109-
T: Encodable + PartialEq + Ord
110-
> Encodable for BTreeSet<T> {
111-
#[inline]
100+
impl<T> Encodable for BTreeSet<T>
101+
where T: Encodable + PartialEq + Ord
102+
{
112103
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
113104
s.emit_seq(self.len(), |s| {
114105
let mut i = 0;
@@ -121,10 +112,9 @@ impl<
121112
}
122113
}
123114

124-
impl<
125-
T: Decodable + PartialEq + Ord
126-
> Decodable for BTreeSet<T> {
127-
#[inline]
115+
impl<T> Decodable for BTreeSet<T>
116+
where T: Decodable + PartialEq + Ord
117+
{
128118
fn decode<D: Decoder>(d: &mut D) -> Result<BTreeSet<T>, D::Error> {
129119
d.read_seq(|d, len| {
130120
let mut set = BTreeSet::new();
@@ -141,7 +131,6 @@ impl<K, V, S> Encodable for HashMap<K, V, S>
141131
V: Encodable,
142132
S: BuildHasher,
143133
{
144-
#[inline]
145134
fn encode<E: Encoder>(&self, e: &mut E) -> Result<(), E::Error> {
146135
e.emit_map(self.len(), |e| {
147136
let mut i = 0;
@@ -160,7 +149,6 @@ impl<K, V, S> Decodable for HashMap<K, V, S>
160149
V: Decodable,
161150
S: BuildHasher + Default,
162151
{
163-
#[inline]
164152
fn decode<D: Decoder>(d: &mut D) -> Result<HashMap<K, V, S>, D::Error> {
165153
d.read_map(|d, len| {
166154
let state = Default::default();
@@ -179,7 +167,6 @@ impl<T, S> Encodable for HashSet<T, S>
179167
where T: Encodable + Hash + Eq,
180168
S: BuildHasher,
181169
{
182-
#[inline]
183170
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error> {
184171
s.emit_seq(self.len(), |s| {
185172
let mut i = 0;
@@ -196,7 +183,6 @@ impl<T, S> Decodable for HashSet<T, S>
196183
where T: Decodable + Hash + Eq,
197184
S: BuildHasher + Default,
198185
{
199-
#[inline]
200186
fn decode<D: Decoder>(d: &mut D) -> Result<HashSet<T, S>, D::Error> {
201187
d.read_seq(|d, len| {
202188
let state = Default::default();
@@ -210,7 +196,6 @@ impl<T, S> Decodable for HashSet<T, S>
210196
}
211197

212198
impl<T: Encodable> Encodable for Rc<[T]> {
213-
#[inline]
214199
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error> {
215200
s.emit_seq(self.len(), |s| {
216201
for (index, e) in self.iter().enumerate() {
@@ -222,7 +207,6 @@ impl<T: Encodable> Encodable for Rc<[T]> {
222207
}
223208

224209
impl<T: Decodable> Decodable for Rc<[T]> {
225-
#[inline]
226210
fn decode<D: Decoder>(d: &mut D) -> Result<Rc<[T]>, D::Error> {
227211
d.read_seq(|d, len| {
228212
let mut vec = Vec::with_capacity(len);
@@ -235,7 +219,6 @@ impl<T: Decodable> Decodable for Rc<[T]> {
235219
}
236220

237221
impl<T: Encodable> Encodable for Arc<[T]> {
238-
#[inline]
239222
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error> {
240223
s.emit_seq(self.len(), |s| {
241224
for (index, e) in self.iter().enumerate() {
@@ -247,7 +230,6 @@ impl<T: Encodable> Encodable for Arc<[T]> {
247230
}
248231

249232
impl<T: Decodable> Decodable for Arc<[T]> {
250-
#[inline]
251233
fn decode<D: Decoder>(d: &mut D) -> Result<Arc<[T]>, D::Error> {
252234
d.read_seq(|d, len| {
253235
let mut vec = Vec::with_capacity(len);

0 commit comments

Comments
 (0)