Skip to content

Commit df27c17

Browse files
committed
fix
Signed-off-by: codephage2020 <tingwangyan2020@163.com>
1 parent 9491836 commit df27c17

File tree

4 files changed

+0
-117
lines changed

4 files changed

+0
-117
lines changed

core/src/raw/ops.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ pub struct OpWrite {
689689
content_type: Option<String>,
690690
content_disposition: Option<String>,
691691
content_encoding: Option<String>,
692-
content_language: Option<String>,
693692
cache_control: Option<String>,
694693
if_match: Option<String>,
695694
if_none_match: Option<String>,
@@ -757,17 +756,6 @@ impl OpWrite {
757756
self
758757
}
759758

760-
/// Get the content language from option
761-
pub fn content_language(&self) -> Option<&str> {
762-
self.content_language.as_deref()
763-
}
764-
765-
/// Set the content language of option
766-
pub fn with_content_language(mut self, content_language: &str) -> Self {
767-
self.content_language = Some(content_language.to_string());
768-
self
769-
}
770-
771759
/// Get the cache control from option
772760
pub fn cache_control(&self) -> Option<&str> {
773761
self.cache_control.as_deref()
@@ -879,7 +867,6 @@ impl From<options::WriteOptions> for (OpWrite, OpWriter) {
879867
content_type: value.content_type,
880868
content_disposition: value.content_disposition,
881869
content_encoding: value.content_encoding,
882-
content_language: value.content_language,
883870
cache_control: value.cache_control,
884871
if_match: value.if_match,
885872
if_none_match: value.if_none_match,

core/src/types/operator/operator_futures.rs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,6 @@ impl<F: Future<Output = Result<PresignedRequest>>> FuturePresignWrite<F> {
238238
self
239239
}
240240

241-
/// Refer to [`options::WriteOptions::content_language`] for more details.
242-
pub fn content_language(mut self, v: &str) -> Self {
243-
self.args.0.content_language = Some(v.to_string());
244-
self
245-
}
246-
247241
/// Refer to [`options::WriteOptions::cache_control`] for more details.
248242
pub fn cache_control(mut self, v: &str) -> Self {
249243
self.args.0.cache_control = Some(v.to_string());
@@ -818,32 +812,6 @@ impl<F: Future<Output = Result<Metadata>>> FutureWrite<F> {
818812
self
819813
}
820814

821-
/// Sets Content-Language header for this write request.
822-
///
823-
/// Refer to [`options::WriteOptions::content_language`] for more details.
824-
///
825-
/// ### Example
826-
///
827-
/// ```
828-
/// # use opendal::Result;
829-
/// # use opendal::Operator;
830-
/// # use futures::StreamExt;
831-
/// # use futures::SinkExt;
832-
/// use bytes::Bytes;
833-
///
834-
/// # async fn test(op: Operator) -> Result<()> {
835-
/// let _ = op
836-
/// .write_with("path/to/file", vec![0; 4096])
837-
/// .content_language("en-US")
838-
/// .await?;
839-
/// # Ok(())
840-
/// # }
841-
/// ```
842-
pub fn content_language(mut self, v: &str) -> Self {
843-
self.args.0.content_language = Some(v.to_string());
844-
self
845-
}
846-
847815
/// Sets If-Match header for this write request.
848816
///
849817
/// Refer to [`options::WriteOptions::if_match`] for more details.
@@ -1163,35 +1131,6 @@ impl<F: Future<Output = Result<Writer>>> FutureWriter<F> {
11631131
self
11641132
}
11651133

1166-
/// Sets Content-Language header for this write request.
1167-
///
1168-
/// Refer to [`options::WriteOptions::content_language`] for more details.
1169-
///
1170-
/// ### Example
1171-
///
1172-
/// ```
1173-
/// # use opendal::Result;
1174-
/// # use opendal::Operator;
1175-
/// # use futures::StreamExt;
1176-
/// # use futures::SinkExt;
1177-
/// use bytes::Bytes;
1178-
///
1179-
/// # async fn test(op: Operator) -> Result<()> {
1180-
/// let mut w = op
1181-
/// .writer_with("path/to/file")
1182-
/// .content_language("en-US")
1183-
/// .await?;
1184-
/// w.write(vec![0; 4096]).await?;
1185-
/// w.write(vec![1; 4096]).await?;
1186-
/// w.close().await?;
1187-
/// # Ok(())
1188-
/// # }
1189-
/// ```
1190-
pub fn content_language(mut self, v: &str) -> Self {
1191-
self.args.content_language = Some(v.to_string());
1192-
self
1193-
}
1194-
11951134
/// Sets If-Match header for this write request.
11961135
///
11971136
/// Refer to [`options::WriteOptions::if_match`] for more details.

core/src/types/options.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -398,26 +398,6 @@ pub struct WriteOptions {
398398
/// This operation allows specifying the encoding applied to the content being written.
399399
pub content_encoding: Option<String>,
400400

401-
/// Sets Content-Language header for this write request.
402-
///
403-
/// ### Capability
404-
///
405-
/// Check [`Capability::write_with_content_language`] before using this feature.
406-
///
407-
/// ### Behavior
408-
///
409-
/// - If supported, sets Content-Language as system metadata on the target file
410-
/// - The value should follow HTTP Content-Language header format
411-
/// - Common values include:
412-
/// - `en-US` - English (United States)
413-
/// - `fr-FR` - French (France)
414-
/// - `zh-CN` - Chinese (China)
415-
/// - `es` - Spanish
416-
/// - If not supported, the value will be ignored
417-
///
418-
/// This operation allows specifying the natural language(s) of the content being written.
419-
pub content_language: Option<String>,
420-
421401
/// Sets user metadata for this write request.
422402
///
423403
/// ### Capability

core/tests/behavior/async_write.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ pub fn tests(op: &Operator, tests: &mut Vec<Trial>) {
4545
test_write_with_content_type,
4646
test_write_with_content_disposition,
4747
test_write_with_content_encoding,
48-
test_write_with_content_language,
4948
test_write_with_if_none_match,
5049
test_write_with_if_not_exists,
5150
test_write_with_if_match,
@@ -233,28 +232,6 @@ pub async fn test_write_with_content_encoding(op: Operator) -> Result<()> {
233232
Ok(())
234233
}
235234

236-
/// write a single file with content language should succeed.
237-
pub async fn test_write_with_content_language(op: Operator) -> Result<()> {
238-
if !op.info().full_capability().write_with_content_language {
239-
return Ok(());
240-
}
241-
242-
let (path, content, _) = TEST_FIXTURE.new_file(op.clone());
243-
244-
let target_content_language = "en-US";
245-
op.write_with(&path, content)
246-
.content_language(target_content_language)
247-
.await?;
248-
249-
let meta = op.stat(&path).await.expect("stat must succeed");
250-
assert_eq!(
251-
meta.content_language()
252-
.expect("content language must exist"),
253-
target_content_language
254-
);
255-
Ok(())
256-
}
257-
258235
/// write a single file with user defined metadata should succeed.
259236
pub async fn test_write_with_user_metadata(op: Operator) -> Result<()> {
260237
if !op.info().full_capability().write_with_user_metadata {

0 commit comments

Comments
 (0)