Skip to content

Commit

Permalink
After 10/31 updates from rcoh
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Oct 31, 2023
1 parent 90847d2 commit f0298d0
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion rust_dev_preview/cross_service/detect_faces/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
.await;
let rek_client = aws_sdk_rekognition::Client::new(&rek_shared_config);

let body = aws_sdk_s3::primitives::ByteStream::from_path_body_0_4(path).await;
let body = aws_sdk_s3::primitives::ByteStream::from_path(path).await;

let key: String = String::from("uploads/") + &filename;

Expand Down
4 changes: 1 addition & 3 deletions rust_dev_preview/cross_service/detect_labels/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ struct Edata {

// snippet-start:[detect_labels-add_file_to_bucket.rust.main]
async fn add_file_to_bucket(client: &aws_sdk_s3::Client, bucket: &str, filename: &str) {
let body =
aws_sdk_s3::primitives::ByteStream::from_path_body_0_4(std::path::Path::new(filename))
.await;
let body = aws_sdk_s3::primitives::ByteStream::from_path(std::path::Path::new(filename)).await;

match body {
Ok(b) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<'a> ZipUpload<'a> {
let bucket = self.bucket;
let key = self.key;

let body = ByteStream::read_with_body_0_4_from()
let body = ByteStream::read_from()
.file(zip.try_into()?)
.buffer_size(4096 * 16)
.build()
Expand Down
2 changes: 1 addition & 1 deletion rust_dev_preview/cross_service/telephone/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async fn save_mp3_file(
println!();
}

let body = aws_sdk_s3::primitives::ByteStream::from_path_body_0_4(Path::new(filename)).await?;
let body = aws_sdk_s3::primitives::ByteStream::from_path(Path::new(filename)).await?;

client
.put_object()
Expand Down
4 changes: 2 additions & 2 deletions rust_dev_preview/examples/glue/src/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl GlueScenario {
.bucket(self.bucket())
.key("job.py")
.body(
ByteStream::from_path_body_0_4(self.script.clone())
ByteStream::from_path(self.script.clone())
.await
.map_err(|err| GlueMvpError::Unknown(format!("{err:?}")))?,
)
Expand All @@ -229,7 +229,7 @@ impl GlueScenario {
.bucket(self.bucket.as_str())
.key("setup_scenario_getting_started.yaml")
.body(
ByteStream::from_path_body_0_4(self.config.clone())
ByteStream::from_path(self.config.clone())
.await
.map_err(|err| GlueMvpError::Unknown(format!("{err:?}")))?,
)
Expand Down
2 changes: 1 addition & 1 deletion rust_dev_preview/examples/s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next"
# snippet-start:[s3.rust.s3-object-lambda-cargo.toml]
aws-endpoint = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
# snippet-end:[s3.rust.s3-object-lambda-cargo.toml]
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["rt-tokio"]}
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-smithy-runtime-api = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["client"] }
aws-smithy-types = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["http-body-0-4-x"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async fn put_object(client: &Client, opts: &Opt) -> Result<(), anyhow::Error> {
debug!("object: {}", opts.object);
debug!("source: {}", opts.source.display());

let body = ByteStream::read_with_body_0_4_from()
let body = ByteStream::read_from()
.path(opts.source.clone())
// Artificially limit the buffer size to ensure the file has multiple
// progress steps.
Expand Down
2 changes: 1 addition & 1 deletion rust_dev_preview/examples/s3/src/bin/s3-helloworld.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn upload_object(

println!();

let body = ByteStream::from_path_body_0_4(Path::new(filename)).await;
let body = ByteStream::from_path(Path::new(filename)).await;

match body {
Ok(b) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async fn run_example() -> Result<(), Error> {
} else {
CHUNK_SIZE
};
let stream = ByteStream::read_with_body_0_4_from()
let stream = ByteStream::read_from()
.path(path)
.offset(chunk_index * CHUNK_SIZE)
.length(Length::Exact(this_chunk))
Expand Down
2 changes: 1 addition & 1 deletion rust_dev_preview/examples/s3/src/s3-service-lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub async fn upload_object(
file_name: &str,
key: &str,
) -> Result<PutObjectOutput, SdkError<PutObjectError>> {
let body = ByteStream::from_path_body_0_4(Path::new(file_name)).await;
let body = ByteStream::from_path(Path::new(file_name)).await;
client
.put_object()
.bucket(bucket_name)
Expand Down

0 comments on commit f0298d0

Please sign in to comment.