Skip to content

Commit

Permalink
Merge pull request #500 from epage/easy
Browse files Browse the repository at this point in the history
fix!: Remove deprecated functionality
  • Loading branch information
epage committed Jan 27, 2023
2 parents 10ea227 + 9bbb831 commit a298404
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 1,676 deletions.
10 changes: 0 additions & 10 deletions crates/toml/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ impl Error {
pub fn span(&self) -> Option<std::ops::Range<usize>> {
self.inner.span()
}

/// Produces a (line, column) pair of the position of the error if available
///
/// All indexes are 0-based.
#[deprecated(since = "0.18.0", note = "See instead `Error::span`")]
#[cfg(feature = "parse")]
pub fn line_col(&self) -> Option<(usize, usize)> {
#[allow(deprecated)]
self.inner.line_col()
}
}

impl serde::de::Error for Error {
Expand Down
66 changes: 0 additions & 66 deletions crates/toml/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,51 +161,6 @@ impl<'d> Serializer<'d> {
ser.settings.multiline_array = true;
ser
}

#[doc(hidden)]
#[deprecated(
since = "0.6.0",
note = "string behavior is now automatic; for greater control deserialize to `toml_edit::Document` and use `toml_edit::visit_mut::VisitorMut`"
)]
pub fn pretty_string(&mut self, _value: bool) -> &mut Self {
self
}

#[doc(hidden)]
#[deprecated(
since = "0.6.0",
note = "string behavior is now automatic; for greater control deserialize to `toml_edit::Document` and use `toml_edit::visit_mut::VisitorMut`"
)]
pub fn pretty_string_literal(&mut self, _value: bool) -> &mut Self {
self
}

#[doc(hidden)]
#[deprecated(
since = "0.6.0",
note = "this is bundled in with `pretty`; for greater control deserialize to `toml_edit::Document` and use `toml_edit::visit_mut::VisitorMut`"
)]
pub fn pretty_array(&mut self, _value: bool) -> &mut Self {
self
}

#[doc(hidden)]
#[deprecated(
since = "0.6.0",
note = "this is bundled in with `pretty`; for greater control deserialize to `toml_edit::Document` and use `toml_edit::visit_mut::VisitorMut`"
)]
pub fn pretty_array_indent(&mut self, _value: usize) -> &mut Self {
self
}

#[doc(hidden)]
#[deprecated(
since = "0.6.0",
note = "this is bundled in with `pretty`; for greater control deserialize to `toml_edit::Document` and use `toml_edit::visit_mut::VisitorMut`"
)]
pub fn pretty_array_trailing_comma(&mut self, _value: bool) -> &mut Self {
self
}
}

#[cfg(feature = "display")]
Expand Down Expand Up @@ -1124,24 +1079,3 @@ mod internal {
Ok(())
}
}

#[doc(hidden)]
#[deprecated(
since = "0.6.0",
note = "`tables_last` is no longer needed; things just work"
)]
pub fn tables_last<'a, I, K, V, S>(data: &'a I, serializer: S) -> Result<S::Ok, S::Error>
where
&'a I: IntoIterator<Item = (K, V)>,
K: serde::ser::Serialize,
V: serde::ser::Serialize,
S: serde::ser::Serializer,
{
use serde::ser::SerializeMap;

let mut map = serializer.serialize_map(None)?;
for (k, v) in data {
map.serialize_entry(&k, &v)?;
}
map.end()
}
3 changes: 1 addition & 2 deletions crates/toml_edit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include = [
]

[package.metadata.docs.rs]
features = ["easy"]
features = ["serde"]

[package.metadata.release]
tag-name = "v{{version}}"
Expand All @@ -36,7 +36,6 @@ pre-release-replacements = [

[features]
default = []
easy = ["serde"]
perf = ["dep:kstring"]
serde = ["dep:serde", "toml_datetime/serde", "dep:serde_spanned"]
# Provide a method disable_recursion_limit to parse arbitrarily deep structures
Expand Down
9 changes: 0 additions & 9 deletions crates/toml_edit/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ impl Error {
pub(crate) fn set_span(&mut self, span: Option<std::ops::Range<usize>>) {
self.inner.set_span(span);
}

/// Produces a (line, column) pair of the position of the error if available
///
/// All indexes are 0-based.
#[deprecated(since = "0.18.0", note = "See instead `Error::span`")]
pub fn line_col(&self) -> Option<(usize, usize)> {
#[allow(deprecated)]
self.inner.line_col()
}
}

impl serde::de::Error for Error {
Expand Down
1 change: 0 additions & 1 deletion crates/toml_edit/src/easy/datetime.rs

This file was deleted.

Loading

0 comments on commit a298404

Please sign in to comment.