File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -270,10 +270,10 @@ jobs:
270
270
grep '] ok 1 - rust_kernel_doctests$' qemu-stdout.log
271
271
272
272
- run : |
273
- grep '] rust_minimal: Rust minimal sample (init)$' qemu-stdout.log
274
- grep '] rust_minimal: Am I built-in? false$' qemu-stdout.log
275
- grep '] rust_minimal: My message is on the heap! $' qemu-stdout.log
276
- grep '] rust_minimal: Rust minimal sample (exit)$' qemu-stdout.log
273
+ grep '] rust_minimal: Rust minimal sample (init)$' qemu-stdout.log
274
+ grep '] rust_minimal: Am I built-in? false$' qemu-stdout.log
275
+ grep '] rust_minimal: My numbers are \[72, 108, 200] $' qemu-stdout.log
276
+ grep '] rust_minimal: Rust minimal sample (exit)$' qemu-stdout.log
277
277
278
278
- run : |
279
279
grep '] rust_print: Rust printing macros sample (init)$' qemu-stdout.log
Original file line number Diff line number Diff line change @@ -13,23 +13,26 @@ module! {
13
13
}
14
14
15
15
struct RustMinimal {
16
- message : String ,
16
+ numbers : Vec < i32 > ,
17
17
}
18
18
19
19
impl kernel:: Module for RustMinimal {
20
20
fn init ( _name : & ' static CStr , _module : & ' static ThisModule ) -> Result < Self > {
21
21
pr_info ! ( "Rust minimal sample (init)\n " ) ;
22
22
pr_info ! ( "Am I built-in? {}\n " , !cfg!( MODULE ) ) ;
23
23
24
- Ok ( RustMinimal {
25
- message : "on the heap!" . try_to_owned ( ) ?,
26
- } )
24
+ let mut numbers = Vec :: new ( ) ;
25
+ numbers. try_push ( 72 ) ?;
26
+ numbers. try_push ( 108 ) ?;
27
+ numbers. try_push ( 200 ) ?;
28
+
29
+ Ok ( RustMinimal { numbers } )
27
30
}
28
31
}
29
32
30
33
impl Drop for RustMinimal {
31
34
fn drop ( & mut self ) {
32
- pr_info ! ( "My message is { }\n " , self . message ) ;
35
+ pr_info ! ( "My numbers are {:? }\n " , self . numbers ) ;
33
36
pr_info ! ( "Rust minimal sample (exit)\n " ) ;
34
37
}
35
38
}
You can’t perform that action at this time.
0 commit comments