Skip to content

README examples use the pre-0.11 API (e.g. RepositoryOptions::password) #502

@arcker

Description

@arcker

Summary

The examples in README.md of rustic_core 0.11.0 still demonstrate the pre-0.11 API and don't compile against the current version.

Reproduce

Following the README "Initializing a Repository" section verbatim:

let repo_opts = RepositoryOptions::default().password("test");
let repo = Repository::new(&repo_opts, backends)?.open()?;

…produces:

error[E0599]: no method named `password` found for struct `RepositoryOptions`

What changed in 0.11

  • RepositoryOptions no longer exposes a .password() setter — credentials moved to a dedicated Credentials enum.
  • Repository::open() now requires &Credentials.
  • Repository::init() now takes (&Credentials, &KeyOptions, &ConfigOptions).

The working 0.11 form is:

let creds = Credentials::Password("test".into());
let repo = Repository::new(&RepositoryOptions::default(), &backends)?.open(&creds)?;

Suggestion

Update the four code blocks in the README ("Initializing", "Creating snapshot", "Restoring", "Checking") to the current API. A short migration note from 0.10 → 0.11 in the changelog or a top-level note in the README would also help anyone bumping the version.

Happy to send a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-triageStatus: Waiting for a maintainer to triage this issue/PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions