File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,10 @@ impl GpioConfig {
197
197
///
198
198
/// If in conflict, the other GPIO config takes priority.
199
199
pub fn update ( & mut self , other : GpioConfig ) {
200
+ if let Some ( symlink_root) = other. symlink_root {
201
+ self . symlink_root = Some ( symlink_root) ;
202
+ }
203
+
200
204
for other_pin in other. pins {
201
205
// determine the case we are dealing with
202
206
let existing = match self . pins . iter_mut ( ) . find ( |p| p. num == other_pin. num ) {
@@ -254,6 +258,9 @@ export = true
254
258
"# ;
255
259
256
260
const PARTIALLY_OVERLAPS_BASIC_CFG : & ' static str = r#"
261
+ [config]
262
+ symlink_root = "/foo/bar/baz"
263
+
257
264
# Add a new alias to pin 73
258
265
[[pins]]
259
266
num = 73
@@ -344,6 +351,8 @@ names = ["wildcard"]
344
351
// perform the merge
345
352
config. update ( cfg2) ;
346
353
354
+ assert_eq ! ( config. get_symlink_root( ) , "/foo/bar/baz" ) ;
355
+
347
356
let reset_button = config. pins . get ( 0 ) . unwrap ( ) ;
348
357
assert_eq ! ( reset_button. num, 73 ) ;
349
358
assert_eq ! ( reset_button. names,
You can’t perform that action at this time.
0 commit comments