1 error: unnecessary structure name repetition
2 --> $DIR/methods.rs:18:25
4 18 | fn add(self, other: T) -> T { self }
5 | ^ help: use the applicable keyword: `Self`
7 = note: `-D use-self` implied by `-D warnings`
9 error: unnecessary structure name repetition
10 --> $DIR/methods.rs:18:31
12 18 | fn add(self, other: T) -> T { self }
13 | ^ help: use the applicable keyword: `Self`
15 error: unnecessary structure name repetition
16 --> $DIR/methods.rs:21:26
18 21 | fn sub(&self, other: T) -> &T { self } // no error, self is a ref
19 | ^ help: use the applicable keyword: `Self`
21 error: unnecessary structure name repetition
22 --> $DIR/methods.rs:21:33
24 21 | fn sub(&self, other: T) -> &T { self } // no error, self is a ref
25 | ^ help: use the applicable keyword: `Self`
27 error: unnecessary structure name repetition
28 --> $DIR/methods.rs:22:21
30 22 | fn div(self) -> T { self } // no error, different #arguments
31 | ^ help: use the applicable keyword: `Self`
33 error: unnecessary structure name repetition
34 --> $DIR/methods.rs:23:25
36 23 | fn rem(self, other: T) { } // no error, wrong return type
37 | ^ help: use the applicable keyword: `Self`
39 error: defining a method called `add` on this type; consider implementing the `std::ops::Add` trait or choosing a less ambiguous name
40 --> $DIR/methods.rs:18:5
42 18 | fn add(self, other: T) -> T { self }
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 = note: `-D should-implement-trait` implied by `-D warnings`
47 error: defining a method called `drop` on this type; consider implementing the `std::ops::Drop` trait or choosing a less ambiguous name
48 --> $DIR/methods.rs:19:5
50 19 | fn drop(&mut self) { }
51 | ^^^^^^^^^^^^^^^^^^^^^^
53 error: methods called `into_*` usually take self by value; consider choosing a less ambiguous name
54 --> $DIR/methods.rs:26:17
56 26 | fn into_u16(&self) -> u16 { 0 }
59 = note: `-D wrong-self-convention` implied by `-D warnings`
61 error: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
62 --> $DIR/methods.rs:28:21
64 28 | fn to_something(self) -> u32 { 0 }
67 error: methods called `new` usually take no self; consider choosing a less ambiguous name
68 --> $DIR/methods.rs:30:12
73 error: methods called `new` usually return `Self`
74 --> $DIR/methods.rs:30:5
79 = note: `-D new-ret-no-self` implied by `-D warnings`
81 error: unnecessary structure name repetition
82 --> $DIR/methods.rs:40:35
84 40 | pub fn new<'b>(s: &'b str) -> Lt<'b> { unimplemented!() }
85 | ^^^^^^ help: use the applicable keyword: `Self`
87 error: unnecessary structure name repetition
88 --> $DIR/methods.rs:49:28
90 49 | pub fn new(s: &str) -> Lt2 { unimplemented!() }
91 | ^^^ help: use the applicable keyword: `Self`
93 error: unnecessary structure name repetition
94 --> $DIR/methods.rs:58:21
96 58 | pub fn new() -> Lt3<'static> { unimplemented!() }
97 | ^^^^^^^^^^^^ help: use the applicable keyword: `Self`
99 error: unnecessary structure name repetition
100 --> $DIR/methods.rs:74:24
102 74 | fn new() -> Option<V<T>> { None }
103 | ^^^^ help: use the applicable keyword: `Self`
105 error: unnecessary structure name repetition
106 --> $DIR/methods.rs:78:19
108 78 | type Output = T;
109 | ^ help: use the applicable keyword: `Self`
111 error: unnecessary structure name repetition
112 --> $DIR/methods.rs:79:25
114 79 | fn mul(self, other: T) -> T { self } // no error, obviously
115 | ^ help: use the applicable keyword: `Self`
117 error: unnecessary structure name repetition
118 --> $DIR/methods.rs:79:31
120 79 | fn mul(self, other: T) -> T { self } // no error, obviously
121 | ^ help: use the applicable keyword: `Self`
123 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
124 --> $DIR/methods.rs:97:13
126 97 | let _ = opt.map(|x| x + 1)
129 99 | | .unwrap_or(0); // should lint even though this call is on a separate line
130 | |____________________________^
132 = note: `-D option-map-unwrap-or` implied by `-D warnings`
133 = note: replace `map(|x| x + 1).unwrap_or(0)` with `map_or(0, |x| x + 1)`
135 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
136 --> $DIR/methods.rs:101:13
138 101 | let _ = opt.map(|x| {
142 104 | | ).unwrap_or(0);
143 | |____________________________^
145 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
146 --> $DIR/methods.rs:105:13
148 105 | let _ = opt.map(|x| x + 1)
153 | |__________________^
155 error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
156 --> $DIR/methods.rs:114:13
158 114 | let _ = opt.map(|x| x + 1)
161 116 | | .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
162 | |____________________________________^
164 = note: `-D option-map-unwrap-or-else` implied by `-D warnings`
165 = note: replace `map(|x| x + 1).unwrap_or_else(|| 0)` with `map_or_else(|| 0, |x| x + 1)`
167 error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
168 --> $DIR/methods.rs:118:13
170 118 | let _ = opt.map(|x| {
174 121 | | ).unwrap_or_else(|| 0);
175 | |____________________________________^
177 error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
178 --> $DIR/methods.rs:122:13
180 122 | let _ = opt.map(|x| x + 1)
182 123 | | .unwrap_or_else(||
185 | |_________________^
187 error: unnecessary structure name repetition
188 --> $DIR/methods.rs:151:24
190 151 | fn filter(self) -> IteratorFalsePositives {
191 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
193 error: unnecessary structure name repetition
194 --> $DIR/methods.rs:155:22
196 155 | fn next(self) -> IteratorFalsePositives {
197 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
199 error: unnecessary structure name repetition
200 --> $DIR/methods.rs:175:32
202 175 | fn skip(self, _: usize) -> IteratorFalsePositives {
203 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
205 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
206 --> $DIR/methods.rs:194:13
208 194 | let _ = v.iter().filter(|&x| *x < 0).next();
209 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211 = note: `-D filter-next` implied by `-D warnings`
212 = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
214 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
215 --> $DIR/methods.rs:197:13
217 197 | let _ = v.iter().filter(|&x| {
222 | |___________________________^
224 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
225 --> $DIR/methods.rs:212:13
227 212 | let _ = v.iter().find(|&x| *x < 0).is_some();
228 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
230 = note: `-D search-is-some` implied by `-D warnings`
231 = note: replace `find(|&x| *x < 0).is_some()` with `any(|&x| *x < 0)`
233 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
234 --> $DIR/methods.rs:215:13
236 215 | let _ = v.iter().find(|&x| {
241 | |______________________________^
243 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
244 --> $DIR/methods.rs:221:13
246 221 | let _ = v.iter().position(|&x| x < 0).is_some();
247 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
249 = note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
251 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
252 --> $DIR/methods.rs:224:13
254 224 | let _ = v.iter().position(|&x| {
259 | |______________________________^
261 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
262 --> $DIR/methods.rs:230:13
264 230 | let _ = v.iter().rposition(|&x| x < 0).is_some();
265 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
267 = note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
269 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
270 --> $DIR/methods.rs:233:13
272 233 | let _ = v.iter().rposition(|&x| {
277 | |______________________________^
279 error: unnecessary structure name repetition
280 --> $DIR/methods.rs:250:21
282 250 | fn new() -> Foo { Foo }
283 | ^^^ help: use the applicable keyword: `Self`
285 error: use of `unwrap_or` followed by a function call
286 --> $DIR/methods.rs:268:5
288 268 | with_constructor.unwrap_or(make());
289 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_constructor.unwrap_or_else(make)`
291 = note: `-D or-fun-call` implied by `-D warnings`
293 error: use of `unwrap_or` followed by a call to `new`
294 --> $DIR/methods.rs:271:5
296 271 | with_new.unwrap_or(Vec::new());
297 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
299 error: use of `unwrap_or` followed by a function call
300 --> $DIR/methods.rs:274:5
302 274 | with_const_args.unwrap_or(Vec::with_capacity(12));
303 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_const_args.unwrap_or_else(|| Vec::with_capacity(12))`
305 error: use of `unwrap_or` followed by a function call
306 --> $DIR/methods.rs:277:5
308 277 | with_err.unwrap_or(make());
309 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err.unwrap_or_else(|_| make())`
311 error: use of `unwrap_or` followed by a function call
312 --> $DIR/methods.rs:280:5
314 280 | with_err_args.unwrap_or(Vec::with_capacity(12));
315 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err_args.unwrap_or_else(|_| Vec::with_capacity(12))`
317 error: use of `unwrap_or` followed by a call to `default`
318 --> $DIR/methods.rs:283:5
320 283 | with_default_trait.unwrap_or(Default::default());
321 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
323 error: use of `unwrap_or` followed by a call to `default`
324 --> $DIR/methods.rs:286:5
326 286 | with_default_type.unwrap_or(u64::default());
327 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
329 error: use of `unwrap_or` followed by a function call
330 --> $DIR/methods.rs:289:5
332 289 | with_vec.unwrap_or(vec![]);
333 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
335 error: use of `unwrap_or` followed by a function call
336 --> $DIR/methods.rs:294:5
338 294 | without_default.unwrap_or(Foo::new());
339 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `without_default.unwrap_or_else(Foo::new)`
341 error: use of `or_insert` followed by a function call
342 --> $DIR/methods.rs:297:5
344 297 | map.entry(42).or_insert(String::new());
345 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `map.entry(42).or_insert_with(String::new)`
347 error: use of `or_insert` followed by a function call
348 --> $DIR/methods.rs:300:5
350 300 | btree.entry(42).or_insert(String::new());
351 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `btree.entry(42).or_insert_with(String::new)`
353 error: use of `unwrap_or` followed by a function call
354 --> $DIR/methods.rs:303:13
356 303 | let _ = stringy.unwrap_or("".to_owned());
357 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `stringy.unwrap_or_else(|| "".to_owned())`
359 error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
360 --> $DIR/methods.rs:314:23
362 314 | let bad_vec = some_vec.iter().nth(3);
363 | ^^^^^^^^^^^^^^^^^^^^^^
365 = note: `-D iter-nth` implied by `-D warnings`
367 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
368 --> $DIR/methods.rs:315:26
370 315 | let bad_slice = &some_vec[..].iter().nth(3);
371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
373 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
374 --> $DIR/methods.rs:316:31
376 316 | let bad_boxed_slice = boxed_slice.iter().nth(3);
377 | ^^^^^^^^^^^^^^^^^^^^^^^^^
379 error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
380 --> $DIR/methods.rs:317:29
382 317 | let bad_vec_deque = some_vec_deque.iter().nth(3);
383 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
385 error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
386 --> $DIR/methods.rs:322:23
388 322 | let bad_vec = some_vec.iter_mut().nth(3);
389 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
391 error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
392 --> $DIR/methods.rs:325:26
394 325 | let bad_slice = &some_vec[..].iter_mut().nth(3);
395 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
397 error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
398 --> $DIR/methods.rs:328:29
400 328 | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
401 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
403 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
404 --> $DIR/methods.rs:340:13
406 340 | let _ = some_vec.iter().skip(42).next();
407 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
409 = note: `-D iter-skip-next` implied by `-D warnings`
411 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
412 --> $DIR/methods.rs:341:13
414 341 | let _ = some_vec.iter().cycle().skip(42).next();
415 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
417 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
418 --> $DIR/methods.rs:342:13
420 342 | let _ = (1..10).skip(10).next();
421 | ^^^^^^^^^^^^^^^^^^^^^^^
423 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
424 --> $DIR/methods.rs:343:14
426 343 | let _ = &some_vec[..].iter().skip(3).next();
427 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
429 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
430 --> $DIR/methods.rs:369:17
432 369 | let _ = boxed_slice.get(1).unwrap();
433 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
435 = note: `-D get-unwrap` implied by `-D warnings`
437 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
438 --> $DIR/methods.rs:370:17
440 370 | let _ = some_slice.get(0).unwrap();
441 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
443 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
444 --> $DIR/methods.rs:371:17
446 371 | let _ = some_vec.get(0).unwrap();
447 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
449 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
450 --> $DIR/methods.rs:372:17
452 372 | let _ = some_vecdeque.get(0).unwrap();
453 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
455 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
456 --> $DIR/methods.rs:373:17
458 373 | let _ = some_hashmap.get(&1).unwrap();
459 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
461 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
462 --> $DIR/methods.rs:374:17
464 374 | let _ = some_btreemap.get(&1).unwrap();
465 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
467 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
468 --> $DIR/methods.rs:379:10
470 379 | *boxed_slice.get_mut(0).unwrap() = 1;
471 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut boxed_slice[0]`
473 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
474 --> $DIR/methods.rs:380:10
476 380 | *some_slice.get_mut(0).unwrap() = 1;
477 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_slice[0]`
479 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
480 --> $DIR/methods.rs:381:10
482 381 | *some_vec.get_mut(0).unwrap() = 1;
483 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vec[0]`
485 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
486 --> $DIR/methods.rs:382:10
488 382 | *some_vecdeque.get_mut(0).unwrap() = 1;
489 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vecdeque[0]`
491 error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
492 --> $DIR/methods.rs:396:13
494 396 | let _ = opt.unwrap();
497 = note: `-D option-unwrap-used` implied by `-D warnings`
499 error: used unwrap() on a Result value. If you don't want to handle the Err case gracefully, consider using expect() to provide a better panic message
500 --> $DIR/methods.rs:399:13
502 399 | let _ = res.unwrap();
505 = note: `-D result-unwrap-used` implied by `-D warnings`
507 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
508 --> $DIR/methods.rs:401:5
510 401 | res.ok().expect("disaster!");
511 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
513 = note: `-D ok-expect` implied by `-D warnings`
515 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
516 --> $DIR/methods.rs:407:5
518 407 | res3.ok().expect("whoof");
519 | ^^^^^^^^^^^^^^^^^^^^^^^^^
521 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
522 --> $DIR/methods.rs:409:5
524 409 | res4.ok().expect("argh");
525 | ^^^^^^^^^^^^^^^^^^^^^^^^
527 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
528 --> $DIR/methods.rs:411:5
530 411 | res5.ok().expect("oops");
531 | ^^^^^^^^^^^^^^^^^^^^^^^^
533 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
534 --> $DIR/methods.rs:413:5
536 413 | res6.ok().expect("meh");
537 | ^^^^^^^^^^^^^^^^^^^^^^^
539 error: you should use the `starts_with` method
540 --> $DIR/methods.rs:425:5
542 425 | "".chars().next() == Some(' ');
543 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".starts_with(' ')`
545 = note: `-D chars-next-cmp` implied by `-D warnings`
547 error: you should use the `starts_with` method
548 --> $DIR/methods.rs:426:5
550 426 | Some(' ') != "".chars().next();
551 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with(' ')`
553 error: calling `.extend(_.chars())`
554 --> $DIR/methods.rs:435:5
556 435 | s.extend(abc.chars());
557 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(abc)`
559 = note: `-D string-extend-chars` implied by `-D warnings`
561 error: calling `.extend(_.chars())`
562 --> $DIR/methods.rs:438:5
564 438 | s.extend("abc".chars());
565 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str("abc")`
567 error: calling `.extend(_.chars())`
568 --> $DIR/methods.rs:441:5
570 441 | s.extend(def.chars());
571 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(&def)`
573 error: using `clone` on a `Copy` type
574 --> $DIR/methods.rs:452:5
577 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
579 = note: `-D clone-on-copy` implied by `-D warnings`
581 error: using `clone` on a `Copy` type
582 --> $DIR/methods.rs:456:5
585 | ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
587 error: using `clone` on a `Copy` type
588 --> $DIR/methods.rs:460:5
591 | ^^^^^^^^^ help: try removing the `clone` call: `t`
593 error: using `clone` on a `Copy` type
594 --> $DIR/methods.rs:462:5
596 462 | Some(t).clone();
597 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
599 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
600 --> $DIR/methods.rs:468:22
602 468 | let z: &Vec<_> = y.clone();
603 | ^^^^^^^^^ help: try dereferencing it: `(*y).clone()`
605 = note: `-D clone-double-ref` implied by `-D warnings`
607 error: single-character string constant used as pattern
608 --> $DIR/methods.rs:475:13
611 | --------^^^- help: try using a char instead: `x.split('x')`
613 = note: `-D single-char-pattern` implied by `-D warnings`
615 error: single-character string constant used as pattern
616 --> $DIR/methods.rs:492:16
618 492 | x.contains("x");
619 | -----------^^^- help: try using a char instead: `x.contains('x')`
621 error: single-character string constant used as pattern
622 --> $DIR/methods.rs:493:19
624 493 | x.starts_with("x");
625 | --------------^^^- help: try using a char instead: `x.starts_with('x')`
627 error: single-character string constant used as pattern
628 --> $DIR/methods.rs:494:17
630 494 | x.ends_with("x");
631 | ------------^^^- help: try using a char instead: `x.ends_with('x')`
633 error: single-character string constant used as pattern
634 --> $DIR/methods.rs:495:12
637 | -------^^^- help: try using a char instead: `x.find('x')`
639 error: single-character string constant used as pattern
640 --> $DIR/methods.rs:496:13
643 | --------^^^- help: try using a char instead: `x.rfind('x')`
645 error: single-character string constant used as pattern
646 --> $DIR/methods.rs:497:14
649 | ---------^^^- help: try using a char instead: `x.rsplit('x')`
651 error: single-character string constant used as pattern
652 --> $DIR/methods.rs:498:24
654 498 | x.split_terminator("x");
655 | -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
657 error: single-character string constant used as pattern
658 --> $DIR/methods.rs:499:25
660 499 | x.rsplit_terminator("x");
661 | --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
663 error: single-character string constant used as pattern
664 --> $DIR/methods.rs:500:17
666 500 | x.splitn(0, "x");
667 | ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
669 error: single-character string constant used as pattern
670 --> $DIR/methods.rs:501:18
672 501 | x.rsplitn(0, "x");
673 | -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
675 error: single-character string constant used as pattern
676 --> $DIR/methods.rs:502:15
678 502 | x.matches("x");
679 | ----------^^^- help: try using a char instead: `x.matches('x')`
681 error: single-character string constant used as pattern
682 --> $DIR/methods.rs:503:16
684 503 | x.rmatches("x");
685 | -----------^^^- help: try using a char instead: `x.rmatches('x')`
687 error: single-character string constant used as pattern
688 --> $DIR/methods.rs:504:21
690 504 | x.match_indices("x");
691 | ----------------^^^- help: try using a char instead: `x.match_indices('x')`
693 error: single-character string constant used as pattern
694 --> $DIR/methods.rs:505:22
696 505 | x.rmatch_indices("x");
697 | -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
699 error: single-character string constant used as pattern
700 --> $DIR/methods.rs:506:25
702 506 | x.trim_left_matches("x");
703 | --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
705 error: single-character string constant used as pattern
706 --> $DIR/methods.rs:507:26
708 507 | x.trim_right_matches("x");
709 | ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
711 error: you are getting the inner pointer of a temporary `CString`
712 --> $DIR/methods.rs:517:5
714 517 | CString::new("foo").unwrap().as_ptr();
715 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
717 = note: `-D temporary-cstring-as-ptr` implied by `-D warnings`
718 = note: that pointer will be invalid outside this expression
719 help: assign the `CString` to a variable to extend its lifetime
720 --> $DIR/methods.rs:517:5
722 517 | CString::new("foo").unwrap().as_ptr();
723 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
725 error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
726 --> $DIR/methods.rs:522:27
728 522 | let v2 : Vec<isize> = v.iter().cloned().collect();
729 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
731 = note: `-D iter-cloned-collect` implied by `-D warnings`
733 error: aborting due to 106 previous errors