diff options
Diffstat (limited to 'net/aws')
-rw-r--r-- | net/aws/src/aws_transcriber/imp.rs | 9 | ||||
-rw-r--r-- | net/aws/src/s3hlssink/imp.rs | 4 | ||||
-rw-r--r-- | net/aws/src/s3url.rs | 16 | ||||
-rw-r--r-- | net/aws/tests/s3.rs | 4 |
4 files changed, 16 insertions, 17 deletions
diff --git a/net/aws/src/aws_transcriber/imp.rs b/net/aws/src/aws_transcriber/imp.rs index 717104e8..3918c61c 100644 --- a/net/aws/src/aws_transcriber/imp.rs +++ b/net/aws/src/aws_transcriber/imp.rs @@ -896,12 +896,11 @@ impl Transcriber { ); if let Some(ref vocabulary) = settings.vocabulary { - query_params.push_str(format!("&vocabulary-name={}", vocabulary).as_str()); + query_params.push_str(format!("&vocabulary-name={vocabulary}").as_str()); } if let Some(ref vocabulary_filter) = settings.vocabulary_filter { - query_params - .push_str(format!("&vocabulary-filter-name={}", vocabulary_filter).as_str()); + query_params.push_str(format!("&vocabulary-filter-name={vocabulary_filter}").as_str()); query_params.push_str( format!( @@ -918,7 +917,7 @@ impl Transcriber { if let Some(ref session_id) = settings.session_id { gst::debug!(CAT, imp: self, "Using session ID: {}", session_id); - query_params.push_str(format!("&session-id={}", session_id).as_str()); + query_params.push_str(format!("&session-id={session_id}").as_str()); } query_params.push_str("&enable-partial-results-stabilization=true"); @@ -951,7 +950,7 @@ impl Transcriber { }; let transcribe_uri = Uri::builder() .scheme("https") - .authority(format!("transcribestreaming.{}.amazonaws.com:8443", region).as_str()) + .authority(format!("transcribestreaming.{region}.amazonaws.com:8443").as_str()) .path_and_query(query_params.clone()) .build() .map_err(|err| { diff --git a/net/aws/src/s3hlssink/imp.rs b/net/aws/src/s3hlssink/imp.rs index 24dea089..bcddd74f 100644 --- a/net/aws/src/s3hlssink/imp.rs +++ b/net/aws/src/s3hlssink/imp.rs @@ -153,7 +153,7 @@ impl S3Upload { let s3_bucket = settings.s3_bucket.as_ref().unwrap().to_string(); let s3_key_prefix = settings.s3_key_prefix.as_ref(); let s3_key = if let Some(key_prefix) = s3_key_prefix { - format!("{}/{}", key_prefix, s3_location) + format!("{key_prefix}/{s3_location}") } else { s3_location }; @@ -718,7 +718,7 @@ impl ObjectImpl for S3HlsSink { let s3_key_prefix = settings.s3_key_prefix.as_ref(); let s3_key = if let Some(key_prefix) = s3_key_prefix { - format!("{}/{}", key_prefix, s3_location) + format!("{key_prefix}/{s3_location}") } else { s3_location.to_string() }; diff --git a/net/aws/src/s3url.rs b/net/aws/src/s3url.rs index 3d601aed..a151ceed 100644 --- a/net/aws/src/s3url.rs +++ b/net/aws/src/s3url.rs @@ -42,14 +42,14 @@ impl ToString for GstS3Url { } pub fn parse_s3_url(url_str: &str) -> Result<GstS3Url, String> { - let url = Url::parse(url_str).map_err(|err| format!("Parse error: {}", err))?; + let url = Url::parse(url_str).map_err(|err| format!("Parse error: {err}"))?; if url.scheme() != "s3" { return Err(format!("Unsupported URI '{}'", url.scheme())); } if !url.has_host() { - return Err(format!("Invalid host in uri '{}'", url)); + return Err(format!("Invalid host in uri '{url}'")); } let host = url.host_str().unwrap(); @@ -64,9 +64,9 @@ pub fn parse_s3_url(url_str: &str) -> Result<GstS3Url, String> { base32::decode(base32::Alphabet::RFC4648 { padding: true }, endpoint).ok_or(())?; let name = String::from_utf8(name).map_err(|_| ())?; let endpoint = String::from_utf8(endpoint).map_err(|_| ())?; - Ok(format!("{}{}", name, endpoint)) + Ok(format!("{name}{endpoint}")) }) - .map_err(|_: ()| format!("Invalid region '{}'", host))?; + .map_err(|_: ()| format!("Invalid region '{host}'"))?; // Note that aws_sdk_s3::Region does not provide any error/validation // methods to check the region argument being passed to it. @@ -75,23 +75,23 @@ pub fn parse_s3_url(url_str: &str) -> Result<GstS3Url, String> { let mut path = url .path_segments() - .ok_or_else(|| format!("Invalid uri '{}'", url))?; + .ok_or_else(|| format!("Invalid uri '{url}'"))?; let bucket = path.next().unwrap().to_string(); let o = path .next() - .ok_or_else(|| format!("Invalid empty object/bucket '{}'", url))?; + .ok_or_else(|| format!("Invalid empty object/bucket '{url}'"))?; let mut object = percent_decode(o.as_bytes()) .decode_utf8() .unwrap() .to_string(); if o.is_empty() { - return Err(format!("Invalid empty object/bucket '{}'", url)); + return Err(format!("Invalid empty object/bucket '{url}'")); } - object = path.fold(object, |o, p| format!("{}/{}", o, p)); + object = path.fold(object, |o, p| format!("{o}/{p}")); let mut q = url.query_pairs(); let v = q.next(); diff --git a/net/aws/tests/s3.rs b/net/aws/tests/s3.rs index a7d0071d..c364a1a8 100644 --- a/net/aws/tests/s3.rs +++ b/net/aws/tests/s3.rs @@ -36,14 +36,14 @@ async fn test_s3() { let bucket = std::env::var("AWS_S3_BUCKET").unwrap_or_else(|_| "gst-plugins-rs-tests".to_string()); let key = format!("s3-test-{:?}.txt", chrono::Utc::now()); - let uri = format!("s3://{}/{}/{}", region, bucket, key); + let uri = format!("s3://{region}/{bucket}/{key}"); let content = "Hello, world!\n".as_bytes(); // Manually add the element so we can configure it before it goes to PLAYING let mut h1 = gst_check::Harness::new_empty(); // Need to add_parse() because the Harness API / Rust bindings aren't conducive to creating and // adding an element manually - h1.add_parse(format!("awss3sink uri={}", uri).as_str()); + h1.add_parse(format!("awss3sink uri={uri}").as_str()); h1.set_src_caps(gst::Caps::builder("text/plain").build()); h1.play(); |