Skip to content

Commit

Permalink
refactor: use struct initializer syntax for RepositoryOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan committed Jun 30, 2023
1 parent 5238dbe commit 5fc8b46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions crates/rustic_core/examples/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ fn main() {
let _ = SimpleLogger::init(LevelFilter::Info, Config::default());

// Open repository
let mut repo_opts = RepositoryOptions::default();
repo_opts.repository = Some("/tmp/repo".to_string());
repo_opts.password = Some("test".to_string());
let repo_opts = RepositoryOptions {
repository: Some("/tmp/repo".to_string()),
password: Some("test".to_string()),
..Default::default()
};
let repo = Repository::new(&repo_opts).unwrap().open().unwrap();

// Check respository with standard options
Expand Down
8 changes: 5 additions & 3 deletions crates/rustic_core/examples/forget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ fn main() {
let _ = SimpleLogger::init(LevelFilter::Info, Config::default());

// Open repository
let mut repo_opts = RepositoryOptions::default();
repo_opts.repository = Some("/tmp/repo".to_string());
repo_opts.password = Some("test".to_string());
let repo_opts = RepositoryOptions {
repository: Some("/tmp/repo".to_string()),
password: Some("test".to_string()),
..Default::default()
};
let repo = Repository::new(&repo_opts).unwrap().open().unwrap();

// Check respository with standard options
Expand Down
8 changes: 5 additions & 3 deletions crates/rustic_core/examples/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ fn main() {
let _ = SimpleLogger::init(LevelFilter::Info, Config::default());

// Open repository
let mut repo_opts = RepositoryOptions::default();
repo_opts.repository = Some("/tmp/repo".to_string());
repo_opts.password = Some("test".to_string());
let repo_opts = RepositoryOptions {
repository: Some("/tmp/repo".to_string()),
password: Some("test".to_string()),
..Default::default()
};
let repo = Repository::new(&repo_opts).unwrap().open().unwrap();

let prune_opts = PruneOpts::default();
Expand Down

0 comments on commit 5fc8b46

Please sign in to comment.