MCPcopy Create free account

hub / github.com/Apress/beginning-rust-2e / functions

Functions846 in github.com/Apress/beginning-rust-2e

Functionmain
It prints: F66 M66 F-8 F43 M43 F19 M19 F0 F-31 [132, 86, 38]*/
Source Code/16-58.rs:3
Functionmain
ILLEGAL. The compiler prints the 5 error messages: mismatched types the trait bound `usize: Neg` is not satisfied the type `[&str]` cannot be indexed
Source Code/05-05.rs:8
Functionmain
ILLEGAL. The compiler prints the error message: borrow of moved value: `b2` */
Source Code/22-20.rs:4
Functionmain
Source Code/03-05.c:4
Functionmain
It prints: 0 a, 1 b, 2 c, */
Source Code/16-34.rs:3
Functionmain
It prints: This is. Length: 2.*/
Source Code/05-20.rs:3
Functionmain
It prints nothing. */
Source Code/16-05.rs:3
Functionmain
It prints: 48 35 20 39 42 33 50 29 27 18 17 16 13 12 */
Source Code/21-10.rs:3
Functionmain
It prints: 48 35 20 39 42 33 50 29 27 18 17 16 13 12 */
Source Code/21-09.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: expected one of `,`, `.`, `?`, or an operator, found `"is not allowed"` */
Source Code/02-12.rs:4
Functionmain
()
Source Code/20-09.rs:22
Functionmain
It prints: Hello*/
Source Code/14-01.rs:3
Functionmain
It prints: 10*/
Source Code/03-30.rs:3
Functionmain
It prints: [4, 56, -2] [7, 81, 12500] [7, 81, 12500] [7, 10, 12500] */
Source Code/05-34.rs:6
Functionmain
The compiler prints twice the warning message: unused `Result` that must be used then the program waits for the user to input a line. If you type: eè€
Source Code/17-10.rs:12
Functionmain
It prints: a, b, c, */
Source Code/16-32.rs:3
Functionmain
It prints: [13, 14] [11, 12, 13]*/
Source Code/15-27.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: `match` arms have incompatible types with the explanation: expected `char`, found `()` */
Source Code/07-22.rs:6
Functionmain
Source Code/13-10.cpp:8
Functionmain
It prints: 26 26 26 26 26 26*/
Source Code/13-11.rs:3
Functionmain
Source Code/06-33.c:5
Functionmain
It prints: 13 12*/
Source Code/22-29.rs:3
Functionmain
It prints: true true true*/
Source Code/03-18.rs:3
Functionmain
It prints: 11 21 31 */
Source Code/16-24.rs:3
Functionmain
It prints: 4 0*/
Source Code/09-18.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: literal out of range for `u8` */
Source Code/15-06.rs:4
Functionmain
It prints: 10 11 20 21 */
Source Code/09-35.rs:3
Functionmain
It prints: true*/
Source Code/03-20.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: the trait bound `i32: HasSquareRoot` is not satisfied with the explanation: the trait `HasSquareRoot`
Source Code/19-08.rs:6
Functionmain
It prints: Error: Err. 2 Error: Err. 4 5 */
Source Code/17-13.rs:6
Functionmain
It prints nothing. */
Source Code/01-14.rs:3
Functionmain
It prints: true false A à*/
Source Code/06-27.rs:3
Functionmain
It prints: 0.33333334*/
Source Code/20-13.rs:3
Functionmain
It prints: 1 2 3*/
Source Code/03-22.rs:3
Functionmain
It prints nothing. */
Source Code/22-01.rs:3
Functionmain
It prints: [10, -8, 18, 0, -14, -2, 6, 10, 6, 2]*/
Source Code/09-29.rs:3
Functionmain
It prints: [45, 12, 10, 8, 7, 4, 1, 0]*/
Source Code/13-02.rs:3
Functionmain
Source Code/07-18.c:4
Functionmain
ILLEGAL. The compiler prints the error message: cannot find value `n` in this scope */
Source Code/04-21.rs:4
Functionmain
It prints: My number: 140*/
Source Code/01-11.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: method `exp` is not a member of trait `HasSqrtAndAbs` */
Source Code/19-17.rs:4
Functionmain
It prints: 60, 10000000, 183.19, Q*/
Source Code/08-08.rs:3
Functionmain
It prints: 0: 97 1: 98 2: 99 3: 48 4: 49 5: 50 6: 195 7: 168 8: 226 9: 130 10: 172 */
Source Code/16-01.rs:14
Functionmain
It prints: 1 1 2 2 4 4 8 8 16 16 4 8 1 4*/
Source Code/12-05.rs:3
Functionmain
It prints: 3 + 5 = 8 3.2 + 5.1 = 8.3 */
Source Code/09-09.rs:5
Functionmain
It prints: 1 0 */
Source Code/04-24.rs:3
Functionmain
It prints: 11*/
Source Code/23-12.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: cannot borrow `v` as mutable, as it is not declared as mutable */
Source Code/16-20.rs:4
Functionmain
It prints: Vec: 640: T, 917: C, 412: S, 670: T, 917: L, [(640, 'T'), (917, 'C'), (412, 'S'), (670, 'T'), (917, 'L')] HashMap: 917: L, 640: T, 412:
Source Code/21-14.rs:9
Functionmain
It prints: [45, 12, 10, 8, 7, 4, 1, 0]*/
Source Code/13-09.rs:3
Functionmain
It prints: 3.1622776601683795 3.1622777*/
Source Code/19-06.rs:3
Functionmain
It prints: 3.1622776601683795 3.1622777*/
Source Code/19-19.rs:3
Functionmain
It prints: 34.4*/
Source Code/13-04.rs:3
Functionmain
It prints: 1 0 65 224 8364*/
Source Code/06-26.rs:3
Functionmain
It prints: 0 10 6*/
Source Code/14-02.rs:3
Functionmain
It prints: SOUTH*/
Source Code/07-11.rs:3
Functionmain
It prints: 1 4 9 16 25 36 49 64 81 100 121 144 169 196 */
Source Code/04-14.rs:3
Functionmain
It prints: 3 + 5 = 8 3.2 + 5.1 = 8.3 */
Source Code/09-10.rs:5
Functionmain
ILLEGAL. The compiler prints the error message: cannot find function `f` in this scope */
Source Code/09-07.rs:4
Functionmain
It prints nothing. */
Source Code/24-01.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: type `i32` cannot be dereferenced */
Source Code/09-30.rs:4
Functionmain
It prints: [36, 1, 15, 9, 4]*/
Source Code/16-50.rs:3
Functionmain
It prints: [72, 101, 108, 108, 111] [72, 101, 108, 108, 111] */
Source Code/16-52.rs:5
Functionmain
ILLEGAL. The compiler prints the two error messages: no method named `next` found for struct `RangeTo` in the current scope no method named `next` fou
Source Code/16-06.rs:5
Functionmain
It prints: 123 abc 123s*/
Source Code/22-18.rs:3
Functionmain
It prints: 33, 22, 11, #, #, */
Source Code/10-17.rs:3
Functionmain
The compiler prints the warning message: this operation will panic at runtime Then, the program panics emitting the message: thread 'main' panicked at
Source Code/05-10.rs:6
Functionmain
It prints: 3*/
Source Code/08-05.rs:3
Functionmain
In a 64-bit system, it prints: 16 16 16; 8 8 8 In a 32-bit system, it prints: 8 8 8; 4 4 4 */
Source Code/14-04.rs:6
Functionmain
In application code:
Source Code/24-13.rs:13
Functionmain
It could print: Pushes into Vec: 11ns per item Insertions into HashSet: 152ns per item Insertions into BTreeSet: 145ns per item Linear search in Vec:
Source Code/21-13.rs:11
Functionmain
ILLEGAL. The compiler prints the error message: cannot define inherent `impl` for a type outside of the crate where the type is defined */
Source Code/19-22.rs:4
Functionmain
It prints: [Err(NotPresent)] [Ok("This is the value")]*/
Source Code/17-06.rs:3
Functionmain
It prints: 3..8, 3, 8, 5 3, 4, 5, 6, 7, */
Source Code/15-03.rs:5
Functionmain
It prints: 12*/
Source Code/03-14.rs:3
Functionmain
It prints: F66 M66 F-8 F43 M43 F19 M19 F0 F-31 [132, 86, 38]*/
Source Code/16-57.rs:3
Functionmain
It prints: positive*/
Source Code/04-01.rs:3
Functionmain
It prints: [4, 56, -2] [7, 81, 12500] [7, 81, 12500] [7, 81, 12500] [7, 10, 12500] [7, 81, 12500] */
Source Code/05-33.rs:6
Functionmain
It panics emitting the message: thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1' */
Source Code/05-11.rs:4
Functionmain
It prints: This is a sentence in English*/
Source Code/05-01.rs:3
Functionmain
It prints: 3 6*/
Source Code/16-41.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: unused variable: `x` and then it prints the warning message: unused variable: `y` */
Source Code/05-07.rs:6
Functionmain
ILLEGAL. The compiler prints the error message: cannot assign twice to immutable variable `iterator` */
Source Code/16-18.rs:4
Functionmain
It prints: 2.3 + 6.5i*/
Source Code/20-05.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: borrow of moved value: `a3` */
Source Code/22-22.rs:4
Functionmain
It prints: Result: 13*/
Source Code/07-20.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive
Source Code/19-21.rs:4
Functionmain
ILLEGAL. The compiler prints the error messages: destructuring assignments are unstable and in expressions, `_` can only be used on the left-hand side
Source Code/03-15.rs:6
Functionmain
If there is the file created by the previous program, this program prints: eè€ */
Source Code/17-22.rs:5
Functionmain
It could print: 1.048312ms 71.587µs*/
Source Code/21-06.rs:3
Functionmain
It prints: Q, 10000000, 183.19, 250*/
Source Code/08-12.rs:3
Functionmain
It prints: Hello, [Hi]*/
Source Code/20-17.rs:3
Functionmain
It prints: 11 21 31 */
Source Code/16-22.rs:3
Functionmain
It panics emitting the message: thread 'main' panicked at 'slice index starts at 4 but ends at 3' */
Source Code/15-17.rs:4
Functionmain
It prints: 22*/
Source Code/03-09.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: mismatched types with the explanation: expected integer, found floating-point number */
Source Code/03-23.rs:6
Functionmain
It prints nothing. */
Source Code/09-21.rs:3
Functionmain
()
Source Code/09-14.rs:5
Functionmain
ILLEGAL. The compiler prints the error message: mismatched types with the explanation: expected `bool`, found `char` */
Source Code/08-06.rs:6
Functionmain
It prints: 0*/
Source Code/06-11.rs:3
← previousnext →301–400 of 846, ranked by callers