Skip to content

Commit

Permalink
fix doctest in azalia-remi crate
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Oct 21, 2024
1 parent 28000aa commit e70e14b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/remi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ remi-gridfs = { version = "0.9.1", optional = true }
remi-s3 = { version = "0.9.1", optional = true }
serde = { version = "1.0.200", optional = true }

# used for README doctest
[dev-dependencies]
tokio = { version = "1.40.0", features = ["rt", "macros"] }

[package.metadata.docs.rs]
all-features = true

Expand Down
12 changes: 7 additions & 5 deletions crates/remi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ use azalia_remi::{
Config,
core::StorageService as _,
fs::StorageConfig
fs
};
#[tokio::main]
async fn main() {
let service = Config::Filesystem(StorageConfig::default().with_directory("/data"));
service.init().await?; // initialize the fs version of remi
let config = fs::StorageConfig {
directory: "/data".into(),
};
// do whatever you want
let service = StorageService::Filesystem(fs::StorageService::with_config(config));
service.init().await.unwrap(); // initialize the fs version of remi
Ok(())
// do whatever you want
}
```

0 comments on commit e70e14b

Please sign in to comment.