@@ -9,10 +9,10 @@ use std::path::Path;
9
9
/// The main configuration.
10
10
#[ derive( Debug , Deserialize , Serialize , PartialEq ) ]
11
11
pub struct Config {
12
- users : Vec < User > ,
13
- organizations : Vec < Organization > ,
14
- local : Vec < String > ,
15
- sources : Vec < Source > ,
12
+ users : Option < Vec < User > > ,
13
+ organizations : Option < Vec < Organization > > ,
14
+ local : Option < Vec < String > > ,
15
+ sources : Option < Vec < Source > > ,
16
16
}
17
17
18
18
impl Config {
@@ -80,7 +80,7 @@ mod tests {
80
80
url = "https://git.acme.corp"
81
81
"# } ;
82
82
let expected = Config {
83
- users : vec ! [
83
+ users : Some ( vec ! [
84
84
User {
85
85
name: "torvalds" . to_string( ) ,
86
86
sources: vec![ "github" . to_string( ) ] ,
@@ -105,21 +105,21 @@ mod tests {
105
105
name: "pbrock" . to_string( ) ,
106
106
sources: vec![ "acme-corp" . to_string( ) ] ,
107
107
} ,
108
- ] ,
109
- organizations : vec ! [
108
+ ] ) ,
109
+ organizations : Some ( vec ! [
110
110
Organization {
111
111
name: "rust-lang" . to_string( ) ,
112
112
sources: vec![ "github" . to_string( ) ] ,
113
113
}
114
- ] ,
115
- local : vec ! [ "jdoe@example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHDGMF+tZQL3dcr1arPst+YP8v33Is0kAJVvyTKrxMw" . parse( ) . unwrap( ) ] ,
116
- sources : vec ! [
114
+ ] ) ,
115
+ local : Some ( vec ! [ "jdoe@example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHDGMF+tZQL3dcr1arPst+YP8v33Is0kAJVvyTKrxMw" . parse( ) . unwrap( ) ] ) ,
116
+ sources : Some ( vec ! [
117
117
Source {
118
118
name: "acme-corp" . to_string( ) ,
119
119
provider: GitProvider :: Gitlab ,
120
120
url: "https://git.acme.corp" . to_string( ) ,
121
121
}
122
- ]
122
+ ] )
123
123
} ;
124
124
125
125
let config = Config :: from_toml ( toml) . unwrap ( ) ;
0 commit comments