Closed iohzrd closed 2 years ago
Sorry for the delay. Also, sorry, but I'm still new to rust, and I'm not entirely sure how to accomplish what you're asking.
Sorry for the delay. Also, sorry, but I'm still new to rust, and I'm not entirely sure how to accomplish what you're asking.
No worries! Basically in ipfs-api-backend-hyper/src/lib.rs
, you would add pub use multipart::client::multipart::Form
(same with ipfs-api-backend-actix/src/lib.rs
). This makes it so there isn't a need to declare a dependency on common_multipart_rfc7578
, since you can import it directly from the backend library.
Then, I would update your doc test to this:
/// ```no_run
/// use ipfs_api::{IpfsApi, IpfsClient, Form};
/// use common_multipart_rfc7578::client::multipart;
/// use std::io::Cursor;
///
/// #[cfg(feature = "with-builder")]
/// let add = ipfs_api::request::Add::builder()
/// .wrap_with_directory(true)
/// .build();
/// #[cfg(not(feature = "with-builder"))]
/// let add = ipfs_api::request::Add {
/// wrap_with_directory: Some(true),
/// ..Default::default()
/// };
///
/// let mut form = Form::default();
/// form.add_reader_file("path", Cursor::new(Vec::new()), "file.txt");
///
/// let client = IpfsClient::default();
/// let res = client.add_with_form(form, add);
/// ```
Rather than import from common_multipart_rfc7578
, you can import the Form directly from ipfs_api
now.
alright, hopefully this fixes it. Thanks for the tip.
Build is still failing. Can you try this: