@@ -49,27 +49,27 @@ fn tracing_truncation() {
49
49
assert_eq ! ( s, String :: from( "..." ) ) ;
50
50
51
51
// we should "round up" to the end of the first emoji
52
- s = two_emoji . clone ( ) ;
52
+ s. clone_from ( & two_emoji ) ;
53
53
truncate_on_char_boundary ( & mut s, 1 ) ;
54
54
assert_eq ! ( s, String :: from( "🤔..." ) ) ;
55
55
56
56
// 4 is a boundary, so we should truncate there
57
- s = two_emoji . clone ( ) ;
57
+ s. clone_from ( & two_emoji ) ;
58
58
truncate_on_char_boundary ( & mut s, 4 ) ;
59
59
assert_eq ! ( s, String :: from( "🤔..." ) ) ;
60
60
61
61
// we should round up to the full string
62
- s = two_emoji . clone ( ) ;
62
+ s. clone_from ( & two_emoji ) ;
63
63
truncate_on_char_boundary ( & mut s, 5 ) ;
64
64
assert_eq ! ( s, two_emoji) ;
65
65
66
66
// end of string is a boundary, so we should truncate there
67
- s = two_emoji . clone ( ) ;
67
+ s. clone_from ( & two_emoji ) ;
68
68
truncate_on_char_boundary ( & mut s, 8 ) ;
69
69
assert_eq ! ( s, two_emoji) ;
70
70
71
71
// we should get the full string back if the new length is longer than the original
72
- s = two_emoji . clone ( ) ;
72
+ s. clone_from ( & two_emoji ) ;
73
73
truncate_on_char_boundary ( & mut s, 10 ) ;
74
74
assert_eq ! ( s, two_emoji) ;
75
75
}
0 commit comments