Skip to content

Commit

Permalink
Remove anyhow from dependencies
Browse files Browse the repository at this point in the history
It is used only in two doc test examples where the concrete type of Result does not matter

Signed-off-by: Mingun <alexander_sergey@mail.ru>
  • Loading branch information
Mingun authored and greenhat616 committed Oct 21, 2024
1 parent bc222a3 commit 2b30c30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ These contributors could not be identified by any legal name:
"toasteater" (github.com/toasteater)
"cetra3" (github.com/cetra3)
"masinc" (github.com/masinc)
"Mingun" (github.com/Mingun)
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ serde = "1.0.195"
unsafe-libyaml = "0.2.11"

[dev-dependencies]
anyhow = "1.0.79"
indoc = "2.0"
serde_derive = "1.0.195"

Expand Down
10 changes: 4 additions & 6 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ type Result<T, E = Error> = std::result::Result<T, E>;
/// Deserializing a single document:
///
/// ```
/// use anyhow::Result;
/// use serde::Deserialize;
/// use serde_yaml_ng::Value;
/// use serde_yaml_ng::{Deserializer, Result, Value};
///
/// fn main() -> Result<()> {
/// let input = "k: 107\n";
/// let de = serde_yaml_ng::Deserializer::from_str(input);
/// let de = Deserializer::from_str(input);
/// let value = Value::deserialize(de)?;
/// println!("{:?}", value);
/// Ok(())
Expand All @@ -40,14 +39,13 @@ type Result<T, E = Error> = std::result::Result<T, E>;
/// Deserializing multi-doc YAML:
///
/// ```
/// use anyhow::Result;
/// use serde::Deserialize;
/// use serde_yaml_ng::Value;
/// use serde_yaml_ng::{Deserializer, Result, Value};
///
/// fn main() -> Result<()> {
/// let input = "---\nk: 107\n...\n---\nj: 106\n";
///
/// for document in serde_yaml_ng::Deserializer::from_str(input) {
/// for document in Deserializer::from_str(input) {
/// let value = Value::deserialize(document)?;
/// println!("{:?}", value);
/// }
Expand Down
4 changes: 2 additions & 2 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ type Result<T, E = Error> = std::result::Result<T, E>;
/// # Example
///
/// ```
/// use anyhow::Result;
/// use serde::Serialize;
/// use std::collections::BTreeMap;
/// use serde_yaml_ng::{Result, Serializer};
///
/// fn main() -> Result<()> {
/// let mut buffer = Vec::new();
/// let mut ser = serde_yaml_ng::Serializer::new(&mut buffer);
/// let mut ser = Serializer::new(&mut buffer);
///
/// let mut object = BTreeMap::new();
/// object.insert("k", 107);
Expand Down

0 comments on commit 2b30c30

Please sign in to comment.