1 error: unnecessary structure name repetition
2 --> $DIR/methods.rs:20:25
4 20 | 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:20:31
12 20 | fn add(self, other: T) -> T { self }
13 | ^ help: use the applicable keyword: `Self`
15 error: unnecessary structure name repetition
16 --> $DIR/methods.rs:23:26
18 23 | 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:23:33
24 23 | 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:24:21
30 24 | 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:25:25
36 25 | 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:20:5
42 20 | 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:21:5
50 21 | 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:28:17
56 28 | 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:30:21
64 30 | 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:32:12
73 error: methods called `new` usually return `Self`
74 --> $DIR/methods.rs:32:5
79 = note: `-D new-ret-no-self` implied by `-D warnings`
81 error: unnecessary structure name repetition
82 --> $DIR/methods.rs:76:24
84 76 | fn new() -> Option<V<T>> { None }
85 | ^^^^ help: use the applicable keyword: `Self`
87 error: unnecessary structure name repetition
88 --> $DIR/methods.rs:80:19
91 | ^ help: use the applicable keyword: `Self`
93 error: unnecessary structure name repetition
94 --> $DIR/methods.rs:81:25
96 81 | fn mul(self, other: T) -> T { self } // no error, obviously
97 | ^ help: use the applicable keyword: `Self`
99 error: unnecessary structure name repetition
100 --> $DIR/methods.rs:81:31
102 81 | fn mul(self, other: T) -> T { self } // no error, obviously
103 | ^ help: use the applicable keyword: `Self`
105 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
106 --> $DIR/methods.rs:99:13
108 99 | let _ = opt.map(|x| x + 1)
111 101 | | .unwrap_or(0); // should lint even though this call is on a separate line
112 | |____________________________^
114 = note: `-D option-map-unwrap-or` implied by `-D warnings`
115 = note: replace `map(|x| x + 1).unwrap_or(0)` with `map_or(0, |x| x + 1)`
117 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
118 --> $DIR/methods.rs:103:13
120 103 | let _ = opt.map(|x| {
124 106 | | ).unwrap_or(0);
125 | |____________________________^
127 error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
128 --> $DIR/methods.rs:107:13
130 107 | let _ = opt.map(|x| x + 1)
135 | |__________________^
137 error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
138 --> $DIR/methods.rs:112:13
140 112 | let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143 = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
145 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
146 --> $DIR/methods.rs:118:13
148 118 | let _ = opt.map(|x| x + 1)
151 120 | | .unwrap_or_else(|| 0); // should lint even though this call is on a separate line
152 | |____________________________________^
154 = note: `-D option-map-unwrap-or-else` implied by `-D warnings`
155 = note: replace `map(|x| x + 1).unwrap_or_else(|| 0)` with `map_or_else(|| 0, |x| x + 1)`
157 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
158 --> $DIR/methods.rs:122:13
160 122 | let _ = opt.map(|x| {
164 125 | | ).unwrap_or_else(|| 0);
165 | |____________________________________^
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:126:13
170 126 | let _ = opt.map(|x| x + 1)
172 127 | | .unwrap_or_else(||
175 | |_________________^
177 error: unnecessary structure name repetition
178 --> $DIR/methods.rs:155:24
180 155 | fn filter(self) -> IteratorFalsePositives {
181 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
183 error: unnecessary structure name repetition
184 --> $DIR/methods.rs:159:22
186 159 | fn next(self) -> IteratorFalsePositives {
187 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
189 error: unnecessary structure name repetition
190 --> $DIR/methods.rs:179:32
192 179 | fn skip(self, _: usize) -> IteratorFalsePositives {
193 | ^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
195 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
196 --> $DIR/methods.rs:198:13
198 198 | let _ = v.iter().filter(|&x| *x < 0).next();
199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201 = note: `-D filter-next` implied by `-D warnings`
202 = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
204 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
205 --> $DIR/methods.rs:201:13
207 201 | let _ = v.iter().filter(|&x| {
212 | |___________________________^
214 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
215 --> $DIR/methods.rs:216:13
217 216 | let _ = v.iter().find(|&x| *x < 0).is_some();
218 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220 = note: `-D search-is-some` implied by `-D warnings`
221 = note: replace `find(|&x| *x < 0).is_some()` with `any(|&x| *x < 0)`
223 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
224 --> $DIR/methods.rs:219:13
226 219 | let _ = v.iter().find(|&x| {
231 | |______________________________^
233 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
234 --> $DIR/methods.rs:225:13
236 225 | let _ = v.iter().position(|&x| x < 0).is_some();
237 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
239 = note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
241 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
242 --> $DIR/methods.rs:228:13
244 228 | let _ = v.iter().position(|&x| {
249 | |______________________________^
251 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
252 --> $DIR/methods.rs:234:13
254 234 | let _ = v.iter().rposition(|&x| x < 0).is_some();
255 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
257 = note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
259 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
260 --> $DIR/methods.rs:237:13
262 237 | let _ = v.iter().rposition(|&x| {
267 | |______________________________^
269 error: unnecessary structure name repetition
270 --> $DIR/methods.rs:254:21
272 254 | fn new() -> Foo { Foo }
273 | ^^^ help: use the applicable keyword: `Self`
275 error: use of `unwrap_or` followed by a function call
276 --> $DIR/methods.rs:272:5
278 272 | with_constructor.unwrap_or(make());
279 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_constructor.unwrap_or_else(make)`
281 = note: `-D or-fun-call` implied by `-D warnings`
283 error: use of `unwrap_or` followed by a call to `new`
284 --> $DIR/methods.rs:275:5
286 275 | with_new.unwrap_or(Vec::new());
287 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
289 error: use of `unwrap_or` followed by a function call
290 --> $DIR/methods.rs:278:5
292 278 | with_const_args.unwrap_or(Vec::with_capacity(12));
293 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_const_args.unwrap_or_else(|| Vec::with_capacity(12))`
295 error: use of `unwrap_or` followed by a function call
296 --> $DIR/methods.rs:281:5
298 281 | with_err.unwrap_or(make());
299 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err.unwrap_or_else(|_| make())`
301 error: use of `unwrap_or` followed by a function call
302 --> $DIR/methods.rs:284:5
304 284 | with_err_args.unwrap_or(Vec::with_capacity(12));
305 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err_args.unwrap_or_else(|_| Vec::with_capacity(12))`
307 error: use of `unwrap_or` followed by a call to `default`
308 --> $DIR/methods.rs:287:5
310 287 | with_default_trait.unwrap_or(Default::default());
311 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
313 error: use of `unwrap_or` followed by a call to `default`
314 --> $DIR/methods.rs:290:5
316 290 | with_default_type.unwrap_or(u64::default());
317 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
319 error: use of `unwrap_or` followed by a function call
320 --> $DIR/methods.rs:293:5
322 293 | with_vec.unwrap_or(vec![]);
323 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
325 error: use of `unwrap_or` followed by a function call
326 --> $DIR/methods.rs:298:5
328 298 | without_default.unwrap_or(Foo::new());
329 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `without_default.unwrap_or_else(Foo::new)`
331 error: use of `or_insert` followed by a function call
332 --> $DIR/methods.rs:301:5
334 301 | map.entry(42).or_insert(String::new());
335 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `map.entry(42).or_insert_with(String::new)`
337 error: use of `or_insert` followed by a function call
338 --> $DIR/methods.rs:304:5
340 304 | btree.entry(42).or_insert(String::new());
341 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `btree.entry(42).or_insert_with(String::new)`
343 error: use of `unwrap_or` followed by a function call
344 --> $DIR/methods.rs:307:13
346 307 | let _ = stringy.unwrap_or("".to_owned());
347 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `stringy.unwrap_or_else(|| "".to_owned())`
349 error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
350 --> $DIR/methods.rs:318:23
352 318 | let bad_vec = some_vec.iter().nth(3);
353 | ^^^^^^^^^^^^^^^^^^^^^^
355 = note: `-D iter-nth` implied by `-D warnings`
357 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
358 --> $DIR/methods.rs:319:26
360 319 | let bad_slice = &some_vec[..].iter().nth(3);
361 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
363 error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
364 --> $DIR/methods.rs:320:31
366 320 | let bad_boxed_slice = boxed_slice.iter().nth(3);
367 | ^^^^^^^^^^^^^^^^^^^^^^^^^
369 error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
370 --> $DIR/methods.rs:321:29
372 321 | let bad_vec_deque = some_vec_deque.iter().nth(3);
373 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
375 error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
376 --> $DIR/methods.rs:326:23
378 326 | let bad_vec = some_vec.iter_mut().nth(3);
379 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
381 error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
382 --> $DIR/methods.rs:329:26
384 329 | let bad_slice = &some_vec[..].iter_mut().nth(3);
385 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
387 error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
388 --> $DIR/methods.rs:332:29
390 332 | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
391 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
393 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
394 --> $DIR/methods.rs:344:13
396 344 | let _ = some_vec.iter().skip(42).next();
397 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
399 = note: `-D iter-skip-next` implied by `-D warnings`
401 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
402 --> $DIR/methods.rs:345:13
404 345 | let _ = some_vec.iter().cycle().skip(42).next();
405 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
407 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
408 --> $DIR/methods.rs:346:13
410 346 | let _ = (1..10).skip(10).next();
411 | ^^^^^^^^^^^^^^^^^^^^^^^
413 error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
414 --> $DIR/methods.rs:347:14
416 347 | let _ = &some_vec[..].iter().skip(3).next();
417 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
419 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
420 --> $DIR/methods.rs:373:17
422 373 | let _ = boxed_slice.get(1).unwrap();
423 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
425 = note: `-D get-unwrap` implied by `-D warnings`
427 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
428 --> $DIR/methods.rs:374:17
430 374 | let _ = some_slice.get(0).unwrap();
431 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
433 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
434 --> $DIR/methods.rs:375:17
436 375 | let _ = some_vec.get(0).unwrap();
437 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
439 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
440 --> $DIR/methods.rs:376:17
442 376 | let _ = some_vecdeque.get(0).unwrap();
443 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
445 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
446 --> $DIR/methods.rs:377:17
448 377 | let _ = some_hashmap.get(&1).unwrap();
449 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
451 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
452 --> $DIR/methods.rs:378:17
454 378 | let _ = some_btreemap.get(&1).unwrap();
455 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
457 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
458 --> $DIR/methods.rs:383:10
460 383 | *boxed_slice.get_mut(0).unwrap() = 1;
461 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut boxed_slice[0]`
463 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
464 --> $DIR/methods.rs:384:10
466 384 | *some_slice.get_mut(0).unwrap() = 1;
467 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_slice[0]`
469 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
470 --> $DIR/methods.rs:385:10
472 385 | *some_vec.get_mut(0).unwrap() = 1;
473 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vec[0]`
475 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
476 --> $DIR/methods.rs:386:10
478 386 | *some_vecdeque.get_mut(0).unwrap() = 1;
479 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vecdeque[0]`
481 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
482 --> $DIR/methods.rs:400:13
484 400 | let _ = opt.unwrap();
487 = note: `-D option-unwrap-used` implied by `-D warnings`
489 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
490 --> $DIR/methods.rs:403:13
492 403 | let _ = res.unwrap();
495 = note: `-D result-unwrap-used` implied by `-D warnings`
497 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
498 --> $DIR/methods.rs:405:5
500 405 | res.ok().expect("disaster!");
501 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
503 = note: `-D ok-expect` implied by `-D warnings`
505 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
506 --> $DIR/methods.rs:411:5
508 411 | res3.ok().expect("whoof");
509 | ^^^^^^^^^^^^^^^^^^^^^^^^^
511 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
512 --> $DIR/methods.rs:413:5
514 413 | res4.ok().expect("argh");
515 | ^^^^^^^^^^^^^^^^^^^^^^^^
517 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
518 --> $DIR/methods.rs:415:5
520 415 | res5.ok().expect("oops");
521 | ^^^^^^^^^^^^^^^^^^^^^^^^
523 error: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result`
524 --> $DIR/methods.rs:417:5
526 417 | res6.ok().expect("meh");
527 | ^^^^^^^^^^^^^^^^^^^^^^^
529 error: you should use the `starts_with` method
530 --> $DIR/methods.rs:429:5
532 429 | "".chars().next() == Some(' ');
533 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".starts_with(' ')`
535 = note: `-D chars-next-cmp` implied by `-D warnings`
537 error: you should use the `starts_with` method
538 --> $DIR/methods.rs:430:5
540 430 | Some(' ') != "".chars().next();
541 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".starts_with(' ')`
543 error: calling `.extend(_.chars())`
544 --> $DIR/methods.rs:439:5
546 439 | s.extend(abc.chars());
547 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(abc)`
549 = note: `-D string-extend-chars` implied by `-D warnings`
551 error: calling `.extend(_.chars())`
552 --> $DIR/methods.rs:442:5
554 442 | s.extend("abc".chars());
555 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str("abc")`
557 error: calling `.extend(_.chars())`
558 --> $DIR/methods.rs:445:5
560 445 | s.extend(def.chars());
561 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.push_str(&def)`
563 error: using `clone` on a `Copy` type
564 --> $DIR/methods.rs:456:5
567 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
569 = note: `-D clone-on-copy` implied by `-D warnings`
571 error: using `clone` on a `Copy` type
572 --> $DIR/methods.rs:460:5
575 | ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
577 error: using '.clone()' on a ref-counted pointer
578 --> $DIR/methods.rs:470:5
581 | ^^^^^^^^^^ help: try this: `Rc::clone(&rc)`
583 = note: `-D clone-on-ref-ptr` implied by `-D warnings`
585 error: using '.clone()' on a ref-counted pointer
586 --> $DIR/methods.rs:473:5
589 | ^^^^^^^^^^^ help: try this: `Arc::clone(&arc)`
591 error: using '.clone()' on a ref-counted pointer
592 --> $DIR/methods.rs:476:5
594 476 | rcweak.clone();
595 | ^^^^^^^^^^^^^^ help: try this: `Weak::clone(&rcweak)`
597 error: using '.clone()' on a ref-counted pointer
598 --> $DIR/methods.rs:479:5
600 479 | arc_weak.clone();
601 | ^^^^^^^^^^^^^^^^ help: try this: `Weak::clone(&arc_weak)`
603 error: using `clone` on a `Copy` type
604 --> $DIR/methods.rs:486:5
607 | ^^^^^^^^^ help: try removing the `clone` call: `t`
609 error: using `clone` on a `Copy` type
610 --> $DIR/methods.rs:488:5
612 488 | Some(t).clone();
613 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
615 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
616 --> $DIR/methods.rs:494:22
618 494 | let z: &Vec<_> = y.clone();
619 | ^^^^^^^^^ help: try dereferencing it: `(*y).clone()`
621 = note: `-D clone-double-ref` implied by `-D warnings`
623 error: single-character string constant used as pattern
624 --> $DIR/methods.rs:501:13
627 | --------^^^- help: try using a char instead: `x.split('x')`
629 = note: `-D single-char-pattern` implied by `-D warnings`
631 error: single-character string constant used as pattern
632 --> $DIR/methods.rs:518:16
634 518 | x.contains("x");
635 | -----------^^^- help: try using a char instead: `x.contains('x')`
637 error: single-character string constant used as pattern
638 --> $DIR/methods.rs:519:19
640 519 | x.starts_with("x");
641 | --------------^^^- help: try using a char instead: `x.starts_with('x')`
643 error: single-character string constant used as pattern
644 --> $DIR/methods.rs:520:17
646 520 | x.ends_with("x");
647 | ------------^^^- help: try using a char instead: `x.ends_with('x')`
649 error: single-character string constant used as pattern
650 --> $DIR/methods.rs:521:12
653 | -------^^^- help: try using a char instead: `x.find('x')`
655 error: single-character string constant used as pattern
656 --> $DIR/methods.rs:522:13
659 | --------^^^- help: try using a char instead: `x.rfind('x')`
661 error: single-character string constant used as pattern
662 --> $DIR/methods.rs:523:14
665 | ---------^^^- help: try using a char instead: `x.rsplit('x')`
667 error: single-character string constant used as pattern
668 --> $DIR/methods.rs:524:24
670 524 | x.split_terminator("x");
671 | -------------------^^^- help: try using a char instead: `x.split_terminator('x')`
673 error: single-character string constant used as pattern
674 --> $DIR/methods.rs:525:25
676 525 | x.rsplit_terminator("x");
677 | --------------------^^^- help: try using a char instead: `x.rsplit_terminator('x')`
679 error: single-character string constant used as pattern
680 --> $DIR/methods.rs:526:17
682 526 | x.splitn(0, "x");
683 | ------------^^^- help: try using a char instead: `x.splitn(0, 'x')`
685 error: single-character string constant used as pattern
686 --> $DIR/methods.rs:527:18
688 527 | x.rsplitn(0, "x");
689 | -------------^^^- help: try using a char instead: `x.rsplitn(0, 'x')`
691 error: single-character string constant used as pattern
692 --> $DIR/methods.rs:528:15
694 528 | x.matches("x");
695 | ----------^^^- help: try using a char instead: `x.matches('x')`
697 error: single-character string constant used as pattern
698 --> $DIR/methods.rs:529:16
700 529 | x.rmatches("x");
701 | -----------^^^- help: try using a char instead: `x.rmatches('x')`
703 error: single-character string constant used as pattern
704 --> $DIR/methods.rs:530:21
706 530 | x.match_indices("x");
707 | ----------------^^^- help: try using a char instead: `x.match_indices('x')`
709 error: single-character string constant used as pattern
710 --> $DIR/methods.rs:531:22
712 531 | x.rmatch_indices("x");
713 | -----------------^^^- help: try using a char instead: `x.rmatch_indices('x')`
715 error: single-character string constant used as pattern
716 --> $DIR/methods.rs:532:25
718 532 | x.trim_left_matches("x");
719 | --------------------^^^- help: try using a char instead: `x.trim_left_matches('x')`
721 error: single-character string constant used as pattern
722 --> $DIR/methods.rs:533:26
724 533 | x.trim_right_matches("x");
725 | ---------------------^^^- help: try using a char instead: `x.trim_right_matches('x')`
727 error: you are getting the inner pointer of a temporary `CString`
728 --> $DIR/methods.rs:543:5
730 543 | CString::new("foo").unwrap().as_ptr();
731 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
733 = note: `-D temporary-cstring-as-ptr` implied by `-D warnings`
734 = note: that pointer will be invalid outside this expression
735 help: assign the `CString` to a variable to extend its lifetime
736 --> $DIR/methods.rs:543:5
738 543 | CString::new("foo").unwrap().as_ptr();
739 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
741 error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
742 --> $DIR/methods.rs:548:27
744 548 | let v2 : Vec<isize> = v.iter().cloned().collect();
745 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
747 = note: `-D iter-cloned-collect` implied by `-D warnings`
749 error: you should use the `starts_with` method
750 --> $DIR/methods.rs:555:8
752 555 | if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
753 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.starts_with('f')`
755 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
756 --> $DIR/methods.rs:555:8
758 555 | if s.chars().next().unwrap() == 'f' { // s.starts_with('f')
759 | ^^^^^^^^^^^^^^^^^^^^^^^^^
761 error: you should use the `ends_with` method
762 --> $DIR/methods.rs:558:8
764 558 | if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
765 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
767 = note: `-D chars-last-cmp` implied by `-D warnings`
769 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
770 --> $DIR/methods.rs:558:8
772 558 | if s.chars().next_back().unwrap() == 'o' { // s.ends_with('o')
773 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
775 error: you should use the `ends_with` method
776 --> $DIR/methods.rs:561:8
778 561 | if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
779 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `s.ends_with('o')`
781 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
782 --> $DIR/methods.rs:561:8
784 561 | if s.chars().last().unwrap() == 'o' { // s.ends_with('o')
785 | ^^^^^^^^^^^^^^^^^^^^^^^^^
787 error: you should use the `starts_with` method
788 --> $DIR/methods.rs:564:8
790 564 | if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
791 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.starts_with('f')`
793 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
794 --> $DIR/methods.rs:564:8
796 564 | if s.chars().next().unwrap() != 'f' { // !s.starts_with('f')
797 | ^^^^^^^^^^^^^^^^^^^^^^^^^
799 error: you should use the `ends_with` method
800 --> $DIR/methods.rs:567:8
802 567 | if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
803 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
805 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
806 --> $DIR/methods.rs:567:8
808 567 | if s.chars().next_back().unwrap() != 'o' { // !s.ends_with('o')
809 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
811 error: you should use the `ends_with` method
812 --> $DIR/methods.rs:570:8
814 570 | if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
815 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!s.ends_with('o')`
817 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
818 --> $DIR/methods.rs:570:8
820 570 | if s.chars().last().unwrap() != 'o' { // !s.ends_with('o')
821 | ^^^^^^^^^^^^^^^^^^^^^^^^^
823 error: you should use the `ends_with` method
824 --> $DIR/methods.rs:577:5
826 577 | "".chars().last() == Some(' ');
827 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
829 error: you should use the `ends_with` method
830 --> $DIR/methods.rs:578:5
832 578 | Some(' ') != "".chars().last();
833 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`
835 error: you should use the `ends_with` method
836 --> $DIR/methods.rs:579:5
838 579 | "".chars().next_back() == Some(' ');
839 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `"".ends_with(' ')`
841 error: you should use the `ends_with` method
842 --> $DIR/methods.rs:580:5
844 580 | Some(' ') != "".chars().next_back();
845 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!"".ends_with(' ')`