cargo_toml_edit-0.0.2/.cargo_vcs_info.json0000644000000001361046102023000142100ustar { "git": { "sha1": "ae32d41b99cfcdd9ed1b4ff4b1274ac582d3174a" }, "path_in_vcs": "" }cargo_toml_edit-0.0.2/.forgejo/workflows/ci.yaml000064400000000000000000000024431046102023000200060ustar 00000000000000on: push: branches: - main pull_request: jobs: test: runs-on: codeberg-small-lazy container: image: quay.io/fedora/nodejs-24:latest strategy: matrix: toolchain: ["stable", "nightly", "1.85"] steps: - uses: actions/checkout@v4 - name: dtolnay/rust-toolchain@master uses: https://github.com/dtolnay/rust-toolchain@master with: toolchain: "${{ matrix.toolchain }}" - name: cargo test run: cargo test --verbose clippy: runs-on: codeberg-small-lazy container: image: quay.io/fedora/nodejs-24:latest steps: - uses: actions/checkout@v4 - name: dtolnay/rust-toolchain@master uses: https://github.com/dtolnay/rust-toolchain@master with: toolchain: nightly components: clippy - name: cargo clippy run: cargo clippy --workspace --verbose --all-features rustfmt: runs-on: codeberg-small-lazy container: image: quay.io/fedora/nodejs-24:latest steps: - uses: actions/checkout@v4 - name: dtolnay/rust-toolchain@master uses: https://github.com/dtolnay/rust-toolchain@master with: toolchain: nightly components: rustfmt - name: rustfmt run: cargo fmt --check cargo_toml_edit-0.0.2/.gitignore000064400000000000000000000000101046102023000147350ustar 00000000000000/target cargo_toml_edit-0.0.2/CHANGELOG.md000064400000000000000000000004341046102023000145700ustar 00000000000000# Release 0.0.2 Simplified logic and public API for filtering target-specific dependencies. Supported architectures and supported target triples no longer need to be supplied separately. # Release 0.0.1 Initial import of code from rust2rpm-helper and addition of minimal Rust API. cargo_toml_edit-0.0.2/Cargo.lock0000644000000123721046102023000121700ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "cargo_toml_edit" version = "0.0.2" dependencies = [ "cfg-expr", "log", "pretty_assertions", "thiserror", "toml_edit", ] [[package]] name = "cfg-expr" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c6b04e07d8080154ed4ac03546d9a2b303cc2fe1901ba0b35b301516e289368" dependencies = [ "smallvec", ] [[package]] name = "diff" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "indexmap" version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "log" version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "pretty_assertions" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", ] [[package]] name = "proc-macro2" version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] [[package]] name = "serde_core" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "syn" version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "thiserror" version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "toml_datetime" version = "1.0.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b320e741db58cac564e26c607d3cc1fdc4a88fd36c879568c07856ed83ff3e9" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" version = "0.25.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca1a40644a28bce036923f6a431df0b34236949d111cc07cb6dca830c9ef2e1" dependencies = [ "indexmap", "toml_datetime", "toml_parser", "toml_writer", "winnow", ] [[package]] name = "toml_parser" version = "1.0.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420" dependencies = [ "winnow", ] [[package]] name = "toml_writer" version = "1.0.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17aaa1c6e3dc22b1da4b6bba97d066e354c7945cac2f7852d4e4e7ca7a6b56d" [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "winnow" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" dependencies = [ "memchr", ] [[package]] name = "yansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" cargo_toml_edit-0.0.2/Cargo.toml0000644000000025511046102023000122110ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2024" rust-version = "1.85.0" name = "cargo_toml_edit" version = "0.0.2" authors = ["Fabio Valentini "] build = false exclude = [ "/clippy.toml", "/rustfmt.toml", ] autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Programmatically edit Cargo.toml manifests" readme = "README.md" keywords = [] categories = [] license = "MIT" repository = "https://codeberg.org/rust2rpm/cargo_toml_edit" resolver = "3" [lib] name = "cargo_toml_edit" path = "src/lib.rs" [[test]] name = "tests" path = "tests/tests.rs" [dependencies.cfg-expr] version = "0.20" [dependencies.log] version = "0.4" [dependencies.thiserror] version = "2" [dependencies.toml_edit] version = "0.25" [dev-dependencies.pretty_assertions] version = "1" [lints.clippy] expect_used = "warn" unwrap_used = "warn" [lints.rust] missing_docs = "warn" cargo_toml_edit-0.0.2/Cargo.toml.orig000064400000000000000000000011461046102023000156470ustar 00000000000000[package] name = "cargo_toml_edit" description = "Programmatically edit Cargo.toml manifests" license = "MIT" version = "0.0.2" edition = "2024" rust-version = "1.85.0" resolver = "3" authors = ["Fabio Valentini "] readme = "README.md" exclude = ["/clippy.toml", "/rustfmt.toml"] categories = [] keywords = [] repository = "https://codeberg.org/rust2rpm/cargo_toml_edit" [dependencies] cfg-expr = "0.20" log = "0.4" thiserror = "2" toml_edit = "0.25" [dev-dependencies] pretty_assertions = "1" [lints.rust] missing_docs = "warn" [lints.clippy] expect_used = "warn" unwrap_used = "warn" cargo_toml_edit-0.0.2/LICENSE000064400000000000000000000020651046102023000137660ustar 00000000000000MIT License Copyright (c) 2023-2026 Fabio Valentini Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cargo_toml_edit-0.0.2/README.md000064400000000000000000000006531046102023000142410ustar 00000000000000# cargo_toml_edit This crate provides functionality for programmatically editing `Cargo.toml` manifests. Current functionality is very limited and only suited for purposes of Linux distribution packaging. The initial implementation was pulled out of [rust2rpm-helper] to make it available as a published Rust crate and not only as a command-line application. [rust2rpm-helper]: https://codeberg.org/rust2rpm/rust2rpm-helper cargo_toml_edit-0.0.2/src/error.rs000064400000000000000000000011141046102023000152410ustar 00000000000000use std::borrow::Cow; #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { /// TOML parsing error #[error(transparent)] InvalidToml { #[from] inner: toml_edit::TomlError, }, /// Cargo.toml manifest parsing error #[error("Invalid Cargo.toml manifest: {}", .message)] InvalidManifest { message: Cow<'static, str> }, } impl Error { pub(crate) fn manifest(message: M) -> Self where M: Into>, { Error::InvalidManifest { message: message.into(), } } } cargo_toml_edit-0.0.2/src/filter.rs000064400000000000000000001015501046102023000154020ustar 00000000000000use std::collections::HashSet; use cfg_expr::{ Expression, Predicate, TargetPredicate, targets::{TargetInfo, Triple}, }; use toml_edit::{DocumentMut, Item}; use super::{Error, Manifest}; /// Filter rules for target-specific dependencies /// /// Target-specific dependencies that don't match any pf the specified targets are /// dropped, i.e. an "empty" filter removes *all* target-specific dependencies. #[derive(Debug)] #[non_exhaustive] pub struct DependencyFilter { /// List of supported targets pub targets: Vec<&'static TargetInfo>, } impl DependencyFilter { /// Initialize an empty filter pub fn empty() -> Self { DependencyFilter { targets: Vec::new() } } } #[derive(Debug, Default)] pub struct Filtered { pub removed_targets: Vec<(String, Item)>, pub removed_dependencies: Vec<(String, bool)>, } impl Manifest { /// Rewrite manifest by applying a filter for dependencies pub fn filter_dependencies(&mut self, filter: &DependencyFilter) -> Result { // collect names of optional dependencies with and without associated implicit features let (_, implicit_optional) = get_optional_features_explicit_implicit(&self.toml)?; let Some(target_item) = self.toml.get_mut("target") else { // no "target" table: nothing to do return Ok(Filtered::default()); }; let Some(targets) = target_item.as_table_mut() else { return Err(Error::manifest("Value at 'target' is not a table")); }; // remove non-applicable target-specific dependencies let removed_targets = filter_targets(targets, filter); // collect names of removed dependencies and if they are optional let removed_with_optional = parse_removed_targets(&removed_targets)?; // collect names of all remaining dependencies and if they are optional let remaining_with_optional = get_dependencies(&self.toml)?; // collect names of optional dependencies for which all occurrences were dropped let dropped_with_optional = get_dropped_dependencies(&removed_with_optional, &remaining_with_optional); // remove references to dropped dependencies from feature dependencies strip_dropped_features(&mut self.toml, dropped_with_optional, &implicit_optional)?; Ok(Filtered { removed_targets, removed_dependencies: removed_with_optional, }) } } fn filter_targets(targets: &mut toml_edit::Table, filter: &DependencyFilter) -> Vec<(String, toml_edit::Item)> { let known_target_triples = get_known_target_triples(); let filter_target_triples: Vec<_> = filter.targets.iter().map(|t| &t.triple).collect(); // remove non-applicable target-specific dependencies let mut removed_targets = Vec::new(); targets.retain(|key, item| { // check if key is a valid target triple // and check if key is a supported target let maybe_triple = Triple::new(key.to_owned()); if known_target_triples.contains(&maybe_triple) { if filter_target_triples.contains(&&maybe_triple) { return true; } else { removed_targets.push((key.to_owned(), item.clone())); return false; } } // check if key is a valid cfg-expression // and check if it is applicable on any supported target match Expression::parse(key) { Ok(expr) => { if cfg_applicable(&expr, &filter.targets) { true } else { removed_targets.push((key.to_owned(), item.clone())); false } }, Err(_) => { log::debug!("Unknown target configuration: '{}'", key); removed_targets.push((key.to_owned(), item.clone())); false }, } }); removed_targets } fn parse_removed_targets(removed_targets: &[(String, toml_edit::Item)]) -> Result, Error> { let result = removed_targets .iter() .map(|(target_name, item)| { let Some(target) = item.as_table() else { return Err(Error::manifest(format!( "Value at 'target.{}' is not a table", target_name ))); }; let mut ret = Vec::new(); // check dependencies if let Some(deps_item) = target.get("dependencies") { let Some(deps) = deps_item.as_table() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies' is not a table", target_name ))); }; for (dep_name, dep_item) in deps { // plain string if let Some(_version) = dep_item.as_str() { ret.push((String::from(dep_name), false)); continue; } // table if let Some(dep) = dep_item.as_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; ret.push((String::from(dep_name), optional)); } else { ret.push((String::from(dep_name), false)); } continue; } // inline table if let Some(dep) = dep_item.as_inline_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; ret.push((String::from(dep_name), optional)); } else { ret.push((String::from(dep_name), false)); } continue; } return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}]' is neither a table nor an inline table", target_name, dep_name, ))); } } // check build-dependencies if let Some(deps_item) = target.get("build-dependencies") { let Some(deps) = deps_item.as_table() else { return Err(Error::manifest(format!( "Value at 'target.{}.build-dependencies' is not a table", target_name ))); }; for (dep_name, dep_item) in deps { // plain string if let Some(_version) = dep_item.as_str() { ret.push((String::from(dep_name), false)); continue; } // table if let Some(dep) = dep_item.as_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.build-dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; ret.push((String::from(dep_name), optional)); } else { ret.push((String::from(dep_name), false)); } continue; } // inline table if let Some(dep) = dep_item.as_inline_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.build-dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; ret.push((String::from(dep_name), optional)); } else { ret.push((String::from(dep_name), false)); } continue; } return Err(Error::manifest(format!( "Value at 'target.{}.build-dependencies[{}]' is neither a table nor an inline table", target_name, dep_name, ))); } } // dev-dependencies cannot be optional or referenced by features Ok(ret) }) .collect::>, Error>>()? .into_iter() .flatten() .collect(); Ok(result) } fn get_dependencies(toml: &DocumentMut) -> Result, Error> { let Some(target_item) = toml.get("target") else { return Ok(HashSet::new()); }; let Some(targets) = target_item.as_table() else { return Err(Error::manifest("Value at 'target' is not a table")); }; let mut remaining_with_optional = HashSet::new(); for (target_name, item) in targets.iter() { let Some(target) = item.as_table() else { return Err(Error::manifest(format!( "Value at 'target.{}' is not a table", target_name ))); }; if let Some(deps_item) = target.get("dependencies") { let Some(deps) = deps_item.as_table() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies' is not a table", target_name ))); }; for (dep_name, dep_item) in deps { // plain string if let Some(_version) = dep_item.as_str() { remaining_with_optional.insert((String::from(dep_name), false)); continue; } // table if let Some(dep) = dep_item.as_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } // inline table if let Some(dep) = dep_item.as_inline_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}]' is neither a table nor an inline table", target_name, dep_name, ))); } } if let Some(deps_item) = target.get("build-dependencies") { let Some(deps) = deps_item.as_table() else { return Err(Error::manifest(format!( "Value at 'target.{}.build-dependencies' is not a table", target_name ))); }; for (dep_name, dep_item) in deps { // plain string if let Some(_version) = dep_item.as_str() { remaining_with_optional.insert((String::from(dep_name), false)); continue; } // table if let Some(dep) = dep_item.as_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.build-dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } // inline table if let Some(dep) = dep_item.as_inline_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}].optional' is not a boolean", target_name, dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } return Err(Error::manifest(format!( "Value at 'target.{}.dependencies[{}]' is neither a table nor an inline table", target_name, dep_name, ))); } } } if let Some(deps_item) = toml.get("dependencies") { let Some(deps) = deps_item.as_table() else { return Err(Error::manifest("Value at 'dependencies' is not a table")); }; for (dep_name, dep_item) in deps { // plain string if let Some(_version) = dep_item.as_str() { remaining_with_optional.insert((String::from(dep_name), false)); continue; } // table if let Some(dep) = dep_item.as_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'dependencies[{}].optional' is not a boolean", dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } // inline table if let Some(dep) = dep_item.as_inline_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'dependencies[{}].optional' is not a boolean", dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } return Err(Error::manifest(format!( "Value at 'dependencies[{}]' is neither a table nor an inline table", dep_name, ))); } } if let Some(deps_item) = toml.get("build-dependencies") { let Some(deps) = deps_item.as_table() else { return Err(Error::manifest("Value at 'build-dependencies' is not a table")); }; for (dep_name, dep_item) in deps { // plain string if let Some(_version) = dep_item.as_str() { remaining_with_optional.insert((String::from(dep_name), false)); continue; } // table if let Some(dep) = dep_item.as_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'build-dependencies[{}].optional' is not a boolean", dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } // inline table if let Some(dep) = dep_item.as_inline_table() { if let Some(optional_item) = dep.get("optional") { let Some(optional) = optional_item.as_bool() else { return Err(Error::manifest(format!( "Value at 'build-dependencies[{}].optional' is not a boolean", dep_name, ))); }; remaining_with_optional.insert((String::from(dep_name), optional)); } else { remaining_with_optional.insert((String::from(dep_name), false)); } continue; } return Err(Error::manifest(format!( "Value at 'build-dependencies[{}]' is neither a table nor an inline table", dep_name, ))); } } Ok(remaining_with_optional) } fn get_optional_features_explicit_implicit(toml: &DocumentMut) -> Result<(HashSet, HashSet), Error> { let dependencies = get_dependencies(toml)?; let optional_dependencies: HashSet = dependencies .into_iter() .filter(|(_, optional)| *optional) .map(|(dep_name, _)| dep_name) .collect(); let mut feature_names: HashSet = HashSet::new(); if let Some(features_item) = toml.get("features") { let Some(features) = features_item.as_table() else { return Err(Error::manifest("Value at 'features' is not a table")); }; for (feature_name, _) in features.iter() { feature_names.insert(feature_name.to_string()); } } let mut explicit_optional: HashSet = HashSet::new(); if let Some(features_item) = toml.get("features") { let Some(features) = features_item.as_table() else { return Err(Error::manifest("Value at 'features' is not a table")); }; for (feature_name, feature_item) in features.iter() { let Some(feature_deps_array) = feature_item.as_array() else { return Err(Error::manifest(format!( "Value at 'features[{}]' is not an array", feature_name ))); }; for (index, feature_dep) in feature_deps_array.iter().enumerate() { let Some(feature_dep_name) = feature_dep.as_str() else { return Err(Error::manifest(format!( "Value at 'features[{}][{}]' is not an array", feature_name, index ))); }; if let Some(dep) = feature_dep_name.strip_prefix("dep:") { explicit_optional.insert(String::from(dep)); } } } } let implicit_optional: HashSet = optional_dependencies .iter() .filter(|dep| !explicit_optional.contains(*dep)) .cloned() .collect(); Ok((explicit_optional, implicit_optional)) } fn get_dropped_dependencies<'a>( removed_with_optional: &'a [(String, bool)], remaining_with_optional: &HashSet<(String, bool)>, ) -> Vec<&'a (String, bool)> { removed_with_optional .iter() .filter(|(dep_name, _optional)| { !remaining_with_optional.contains(&(dep_name.to_owned(), true)) && !remaining_with_optional.contains(&(dep_name.to_owned(), false)) }) .collect() } fn strip_dropped_features( toml: &mut DocumentMut, dropped_with_optional: Vec<&(String, bool)>, implicit_optional: &HashSet, ) -> Result<(), Error> { let mut dropped_features: HashSet = HashSet::new(); if let Some(features_item) = toml.get_mut("features") { let Some(features) = features_item.as_table_mut() else { return Err(Error::manifest("Value at 'features' is not a table")); }; for (feature_name, feature_item) in features.iter_mut() { let Some(feature_deps_array) = feature_item.as_array_mut() else { return Err(Error::manifest(format!( "Value at 'features[{}]' is not an array", feature_name ))); }; let feature_deps_len = feature_deps_array.len(); let mut removed_feat_dep = HashSet::new(); for (index, feature_dep) in feature_deps_array.iter().enumerate() { let Some(feature_dep_name) = feature_dep.as_str() else { return Err(Error::manifest(format!( "Value at 'features[{}][{}]' is not an array", feature_name, index ))); }; if implicit_optional.contains(feature_dep_name) && dropped_with_optional.contains(&&(String::from(feature_dep_name), true)) { removed_feat_dep.insert(String::from(feature_dep_name)); } if let Some(dep) = feature_dep_name.strip_prefix("dep:") { if dropped_with_optional.contains(&&(String::from(dep), true)) { removed_feat_dep.insert(String::from(feature_dep_name)); if feature_name == dep && feature_deps_len == 1 { dropped_features.insert(feature_name.to_string()); } } continue; } if let Some((dep, _feat)) = feature_dep_name.split_once("?/") { if dropped_with_optional.contains(&&(String::from(dep), true)) { removed_feat_dep.insert(String::from(feature_dep_name)); } continue; } if let Some((dep, _feat)) = feature_dep_name.split_once('/') { if dropped_with_optional.contains(&&(String::from(dep), true)) || dropped_with_optional.contains(&&(String::from(dep), false)) { removed_feat_dep.insert(String::from(feature_dep_name)); } continue; } } feature_deps_array.retain(|dep| { if let Some(name) = dep.as_str() { !removed_feat_dep.contains(name) } else { log::debug!( "Feature '{}' dependency '{}' is not a string and was ignored", feature_name, dep ); true } }); } features.retain(|key, _value| !dropped_features.contains(key)); } Ok(()) } fn get_known_target_triples() -> HashSet { cfg_expr::targets::ALL_BUILTINS .iter() .map(|t| t.triple.clone()) .collect() } fn cfg_applicable(expression: &Expression, filter: &[&TargetInfo]) -> bool { if expression.original() == "any()" { // empty "any()" predicates are used as "hacks" to improve cargo // dependency resolution and need to be kept return true; } filter .iter() .any(|target_triple| expression.eval(|pred| cfg_evaluate(pred, target_triple))) } fn cfg_evaluate(predicate: &Predicate, target_triple: &TargetInfo) -> bool { use Predicate::*; use TargetPredicate as TP; match predicate { Target(target) => { let e = target.matches(target_triple); match target { TP::Arch(arch) => { log::trace!("eval: target_arch = {} => {}", arch, e); }, TP::Endian(endian) => { log::trace!("eval: target_endian = {:?} => {}", endian, e); }, TP::Env(env) => { log::trace!("eval: target_env = {} => {}", env, e); }, TP::Family(family) => { log::trace!("eval: target_family = {} => {}", family, e); }, TP::HasAtomic(atomic) => { log::trace!("eval: target_has_atomic = {} => {}", atomic, e); }, TP::Os(os) => { log::trace!("eval: target_os = {} => {}", os, e); }, TP::PointerWidth(pointer_width) => { log::trace!("eval: target_pointer_width = {} => {}", pointer_width, e); }, TP::Vendor(vendor) => { log::trace!("eval: target_vendor = {} => {}", vendor, e); }, // ignore predicates that are not supported in Cargo.toml TP::Panic(panic) => { log::trace!("eval: panic = {} => false", panic); return false; }, // ignore unstable attributes TP::Abi(abi) => { log::trace!("eval: abi = {} => true", abi); return true; }, } e }, TargetFeature(_) => true, // ignore unknown bare predicates Flag(flag) => { log::trace!("eval: {} => false", flag); false }, // ignore predicates that are not supported in Cargo.toml Test => { log::trace!("eval: test => false"); false }, DebugAssertions => { log::trace!("eval: debug_assertions => false"); false }, ProcMacro => { log::trace!("eval: proc_macro => false"); false }, Feature(feature) => { log::trace!("eval: feature = {} => false", feature); false }, KeyValue { key, val } => { log::trace!("eval: {} = {} => false", key, val); false }, } } #[cfg(test)] mod tests { use cfg_expr::targets::get_builtin_target_by_triple; use super::*; #[test] fn test_cfg_applicable() { #[rustfmt::skip] let test_cases = [ ("cfg(any())", true), ("cfg(target_os = \"macos\")", false), ("cfg(any(foo, bar))", false), ("cfg(all(unix, target_pointer_width = \"16\"))", false), ("cfg(all(unix, target_pointer_width = \"32\"))", true), ("cfg(all(unix, target_pointer_width = \"64\"))", true), ("cfg(not(foo))", true), ("cfg(unix)", true), ("cfg(not(unix))", false), ("cfg(windows)", false), ("cfg(miri)", false), ("cfg(linux)", false), ("cfg(not(windows))", true), ("cfg(any(unix, windows))", true), ("cfg(any(windows, unix))", true), ("cfg(any(windows, windows, windows))", false), ("cfg(target_os = \"linux\")", true), ("cfg(any(target_os = \"linux\"))", true), ("cfg(all(target_os = \"linux\"))", true), ("cfg(any(target_os = \"linux\", target_os = \"macos\"))", true), ("cfg(any(target_pointer_width = \"16\", target_pointer_width = \"32\", target_pointer_width = \"64\"))", true), ("cfg(any(target_os = \"android\", target_os = \"linux\"))", true), // from rustix 0.36.8 ("cfg(all(criterion, not(any(target_os = \"emscripten\", target_os = \"wasi\"))))", false), ("cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\"))))))))", true), ("cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))", true), ("cfg(any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))))", true), ("cfg(any(target_os = \"android\", target_os = \"linux\"))", true), // from tokio 1.21.2 ("cfg(all(any(target_arch = \"wasm32\", target_arch = \"wasm64\"), not(target_os = \"wasi\")))", false), ("cfg(loom)", false), ("cfg(not(all(any(target_arch = \"wasm32\", target_arch = \"wasm64\"), target_os = \"unknown\")))", true), ("cfg(not(any(target_arch = \"wasm32\", target_arch = \"wasm64\")))", true), ("cfg(target_os = \"freebsd\")", false), ("cfg(tokio_unstable)", false), ]; // default configuration for Fedora let target_triples: [&str; 7] = [ "x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu", ]; let target_triples: Vec<_> = target_triples .iter() .map(|t| get_builtin_target_by_triple(t).unwrap()) .collect(); for (expr, expected) in test_cases { let cfg = Expression::parse(expr).unwrap(); assert_eq!(cfg_applicable(&cfg, &target_triples), expected, "{}", expr); } } #[test] fn need_triple_expression_filters() { let test_cases = [ ("cfg(any(target_env =\"musl\", target_arch=\"wasm64\"))", true), ("cfg(any(target_os =\"hurd\", target_arch=\"wasm64\"))", true), ("cfg(any(target_pointer_width =\"32\", target_arch=\"wasm64\"))", true), ]; let target_triples: [&str; 3] = [ "x86_64-unknown-linux-musl", "x86_64-unknown-hurd-gnu", "x86_64-unknown-linux-gnux32", ]; let target_triples: Vec<_> = target_triples .iter() .map(|t| get_builtin_target_by_triple(t).unwrap()) .collect(); for (expr, expected) in test_cases { let cfg = Expression::parse(expr).unwrap(); assert_eq!(cfg_applicable(&cfg, &target_triples), expected, "{}", expr); } } } cargo_toml_edit-0.0.2/src/lib.rs000064400000000000000000000016651046102023000146710ustar 00000000000000#![doc = include_str!("../README.md")] mod error; mod filter; mod normalize; use std::fmt::Display; use std::str::FromStr; use toml_edit::DocumentMut; pub use error::Error; pub use filter::DependencyFilter; pub use cfg_expr; /// Parsed TOML manifest #[derive(Debug)] pub struct Manifest { toml: DocumentMut, } impl FromStr for Manifest { type Err = toml_edit::TomlError; fn from_str(s: &str) -> Result { let toml: DocumentMut = s.parse()?; Ok(Manifest { toml }) } } impl From for Manifest { fn from(value: DocumentMut) -> Self { Self { toml: value } } } impl Display for Manifest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.toml) } } #[cfg(test)] mod test { use super::*; #[test] fn smoke() { let _manifest: Manifest = include_str!("../Cargo.toml").parse().unwrap(); } } cargo_toml_edit-0.0.2/src/normalize.rs000064400000000000000000000022411046102023000161120ustar 00000000000000use toml_edit::{Entry, Formatted, Item, Value}; use super::{Error, Manifest}; impl Manifest { /// Rewrite manifest by applying version normalization /// /// This drops any `"+meta"` suffix present in the SemVer string. pub fn normalize_version(&mut self) -> Result<(), Error> { let Some(package_item) = self.toml.get_mut("package") else { return Err(Error::manifest("Value at 'package' missing")); }; let Some(package) = package_item.as_table_mut() else { return Err(Error::manifest("Value at 'package' is not a table")); }; let Entry::Occupied(mut version_entry) = package.entry("version") else { return Err(Error::manifest("Value at 'package.version' missing")); }; let Some(version) = version_entry.get().as_str() else { return Err(Error::manifest("Value at 'package.version' is not a string")); }; if let Some((version_no_meta, _meta)) = version.split_once('+') { version_entry.insert(Item::Value(Value::String(Formatted::new(String::from( version_no_meta, ))))); }; Ok(()) } } cargo_toml_edit-0.0.2/tests/data/anstream-0.5.0.Cargo.toml000064400000000000000000000054611046102023000212360ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70.0" name = "anstream" version = "0.5.0" include = [ "build.rs", "src/**/*", "Cargo.toml", "Cargo.lock", "LICENSE*", "README.md", "benches/**/*", "examples/**/*", ] description = "A simple cross platform library for writing colored text to a terminal." homepage = "https://github.com/rust-cli/anstyle" readme = "README.md" keywords = [ "ansi", "terminal", "color", "strip", "wincon", ] categories = ["command-line-interface"] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-cli/anstyle.git" [package.metadata.docs.rs] cargo-args = [ "-Zunstable-options", "-Zrustdoc-scrape-examples", ] rustdoc-args = [ "--cfg", "docsrs", ] [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" min = 1 replace = "{{version}}" search = "Unreleased" [[package.metadata.release.pre-release-replacements]] exactly = 1 file = "CHANGELOG.md" replace = "...{{tag_name}}" search = '\.\.\.HEAD' [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" min = 1 replace = "{{date}}" search = "ReleaseDate" [[package.metadata.release.pre-release-replacements]] exactly = 1 file = "CHANGELOG.md" replace = """ ## [Unreleased] - ReleaseDate """ search = "" [[package.metadata.release.pre-release-replacements]] exactly = 1 file = "CHANGELOG.md" replace = """ [Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD""" search = "" [[bench]] name = "strip" harness = false [[bench]] name = "wincon" harness = false [[bench]] name = "stream" harness = false [dependencies.anstyle] version = "1.0.0" [dependencies.anstyle-parse] version = "0.2.0" [dependencies.anstyle-query] version = "1.0.0" optional = true [dependencies.colorchoice] version = "1.0.0" optional = true [dependencies.utf8parse] version = "0.2.1" [dev-dependencies.criterion] version = "0.4.0" [dev-dependencies.owo-colors] version = "3.5.0" [dev-dependencies.proptest] version = "1.1.0" [dev-dependencies.strip-ansi-escapes] version = "0.1.1" [features] auto = [ "dep:anstyle-query", "dep:colorchoice", ] default = [ "auto", "wincon", ] wincon = ["dep:anstyle-wincon"] [target."cfg(windows)".dependencies.anstyle-wincon] version = "2.0.0" optional = true cargo_toml_edit-0.0.2/tests/data/anstream-0.5.0.Cargo.toml.patched000064400000000000000000000053061046102023000226430ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70.0" name = "anstream" version = "0.5.0" include = [ "build.rs", "src/**/*", "Cargo.toml", "Cargo.lock", "LICENSE*", "README.md", "benches/**/*", "examples/**/*", ] description = "A simple cross platform library for writing colored text to a terminal." homepage = "https://github.com/rust-cli/anstyle" readme = "README.md" keywords = [ "ansi", "terminal", "color", "strip", "wincon", ] categories = ["command-line-interface"] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-cli/anstyle.git" [package.metadata.docs.rs] cargo-args = [ "-Zunstable-options", "-Zrustdoc-scrape-examples", ] rustdoc-args = [ "--cfg", "docsrs", ] [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" min = 1 replace = "{{version}}" search = "Unreleased" [[package.metadata.release.pre-release-replacements]] exactly = 1 file = "CHANGELOG.md" replace = "...{{tag_name}}" search = '\.\.\.HEAD' [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" min = 1 replace = "{{date}}" search = "ReleaseDate" [[package.metadata.release.pre-release-replacements]] exactly = 1 file = "CHANGELOG.md" replace = """ ## [Unreleased] - ReleaseDate """ search = "" [[package.metadata.release.pre-release-replacements]] exactly = 1 file = "CHANGELOG.md" replace = """ [Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD""" search = "" [[bench]] name = "strip" harness = false [[bench]] name = "wincon" harness = false [[bench]] name = "stream" harness = false [dependencies.anstyle] version = "1.0.0" [dependencies.anstyle-parse] version = "0.2.0" [dependencies.anstyle-query] version = "1.0.0" optional = true [dependencies.colorchoice] version = "1.0.0" optional = true [dependencies.utf8parse] version = "0.2.1" [dev-dependencies.criterion] version = "0.4.0" [dev-dependencies.owo-colors] version = "3.5.0" [dev-dependencies.proptest] version = "1.1.0" [dev-dependencies.strip-ansi-escapes] version = "0.1.1" [features] auto = [ "dep:anstyle-query", "dep:colorchoice", ] default = [ "auto", "wincon", ] wincon = [] cargo_toml_edit-0.0.2/tests/data/backtrace-0.3.69.Cargo.toml000064400000000000000000000062271046102023000214410ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "backtrace" version = "0.3.69" authors = ["The Rust Project Developers"] build = "build.rs" exclude = ["/ci/"] autoexamples = true autotests = true description = """ A library to acquire a stack trace (backtrace) at runtime in a Rust program. """ homepage = "https://github.com/rust-lang/backtrace-rs" documentation = "https://docs.rs/backtrace" readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/backtrace-rs" [[example]] name = "backtrace" required-features = ["std"] [[example]] name = "raw" required-features = ["std"] [[test]] name = "skip_inner_frames" required-features = ["std"] [[test]] name = "long_fn_name" required-features = ["std"] [[test]] name = "smoke" required-features = ["std"] edition = "2018" [[test]] name = "accuracy" required-features = ["std"] edition = "2018" [[test]] name = "concurrent-panics" harness = false required-features = ["std"] [[test]] name = "current-exe-mismatch" harness = false required-features = ["std"] [dependencies.cfg-if] version = "1.0" [dependencies.cpp_demangle] version = "0.4.0" features = ["alloc"] optional = true default-features = false [dependencies.rustc-demangle] version = "0.1.4" [dependencies.rustc-serialize] version = "0.3" optional = true [dependencies.serde] version = "1.0" features = ["derive"] optional = true [dev-dependencies.libloading] version = "0.7" [build-dependencies.cc] version = "1.0.67" [features] coresymbolication = [] dbghelp = [] default = ["std"] dladdr = [] gimli-symbolize = [] kernel32 = [] libbacktrace = [] libunwind = [] serialize-rustc = ["rustc-serialize"] serialize-serde = ["serde"] std = [] unix-backtrace = [] verify-winapi = [ "winapi/dbghelp", "winapi/handleapi", "winapi/libloaderapi", "winapi/memoryapi", "winapi/minwindef", "winapi/processthreadsapi", "winapi/synchapi", "winapi/tlhelp32", "winapi/winbase", "winapi/winnt", ] [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.addr2line] version = "0.21.0" default-features = false [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.libc] version = "0.2.146" default-features = false [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.miniz_oxide] version = "0.7.0" default-features = false [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.object] version = "0.32.0" features = [ "read_core", "elf", "macho", "pe", "unaligned", "archive", ] default-features = false [target."cfg(windows)".dependencies.winapi] version = "0.3.9" optional = true cargo_toml_edit-0.0.2/tests/data/backtrace-0.3.69.Cargo.toml.patched000064400000000000000000000055271046102023000230520ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "backtrace" version = "0.3.69" authors = ["The Rust Project Developers"] build = "build.rs" exclude = ["/ci/"] autoexamples = true autotests = true description = """ A library to acquire a stack trace (backtrace) at runtime in a Rust program. """ homepage = "https://github.com/rust-lang/backtrace-rs" documentation = "https://docs.rs/backtrace" readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/backtrace-rs" [[example]] name = "backtrace" required-features = ["std"] [[example]] name = "raw" required-features = ["std"] [[test]] name = "skip_inner_frames" required-features = ["std"] [[test]] name = "long_fn_name" required-features = ["std"] [[test]] name = "smoke" required-features = ["std"] edition = "2018" [[test]] name = "accuracy" required-features = ["std"] edition = "2018" [[test]] name = "concurrent-panics" harness = false required-features = ["std"] [[test]] name = "current-exe-mismatch" harness = false required-features = ["std"] [dependencies.cfg-if] version = "1.0" [dependencies.cpp_demangle] version = "0.4.0" features = ["alloc"] optional = true default-features = false [dependencies.rustc-demangle] version = "0.1.4" [dependencies.rustc-serialize] version = "0.3" optional = true [dependencies.serde] version = "1.0" features = ["derive"] optional = true [dev-dependencies.libloading] version = "0.7" [build-dependencies.cc] version = "1.0.67" [features] coresymbolication = [] dbghelp = [] default = ["std"] dladdr = [] gimli-symbolize = [] kernel32 = [] libbacktrace = [] libunwind = [] serialize-rustc = ["rustc-serialize"] serialize-serde = ["serde"] std = [] unix-backtrace = [] verify-winapi = [ ] [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.addr2line] version = "0.21.0" default-features = false [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.libc] version = "0.2.146" default-features = false [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.miniz_oxide] version = "0.7.0" default-features = false [target."cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))".dependencies.object] version = "0.32.0" features = [ "read_core", "elf", "macho", "pe", "unaligned", "archive", ] default-features = false cargo_toml_edit-0.0.2/tests/data/bytes-1.5.0.Cargo.toml000064400000000000000000000022751046102023000205530ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "bytes" version = "1.5.0" authors = [ "Carl Lerche ", "Sean McArthur ", ] description = "Types and traits for working with bytes" readme = "README.md" keywords = [ "buffers", "zero-copy", "io", ] categories = [ "network-programming", "data-structures", ] license = "MIT" repository = "https://github.com/tokio-rs/bytes" [package.metadata.docs.rs] rustdoc-args = [ "--cfg", "docsrs", ] [dependencies.serde] version = "1.0.60" features = ["alloc"] optional = true default-features = false [dev-dependencies.serde_test] version = "1.0" [features] default = ["std"] std = [] [target."cfg(loom)".dev-dependencies.loom] version = "0.5" cargo_toml_edit-0.0.2/tests/data/bytes-1.5.0.Cargo.toml.patched000064400000000000000000000022011046102023000221470ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "bytes" version = "1.5.0" authors = [ "Carl Lerche ", "Sean McArthur ", ] description = "Types and traits for working with bytes" readme = "README.md" keywords = [ "buffers", "zero-copy", "io", ] categories = [ "network-programming", "data-structures", ] license = "MIT" repository = "https://github.com/tokio-rs/bytes" [package.metadata.docs.rs] rustdoc-args = [ "--cfg", "docsrs", ] [dependencies.serde] version = "1.0.60" features = ["alloc"] optional = true default-features = false [dev-dependencies.serde_test] version = "1.0" [features] default = ["std"] std = [] cargo_toml_edit-0.0.2/tests/data/bzip2-sys-0.1.11.Cargo.toml000064400000000000000000000022511046102023000213360ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "bzip2-sys" version = "0.1.11+1.0.8" authors = ["Alex Crichton "] build = "build.rs" links = "bzip2" description = "Bindings to libbzip2 for bzip2 compression and decompression exposed as\nReader/Writer streams.\n" homepage = "https://github.com/alexcrichton/bzip2-rs" documentation = "https://docs.rs/bzip2-sys" categories = ["external-ffi-bindings"] license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/bzip2-rs" [lib] name = "bzip2_sys" path = "lib.rs" [dependencies.libc] version = "0.2" [build-dependencies.cc] version = "1.0" [build-dependencies.pkg-config] version = "0.3.9" [features] static = [] cargo_toml_edit-0.0.2/tests/data/bzip2-sys-0.1.11.Cargo.toml.patched000064400000000000000000000022431046102023000227460ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "bzip2-sys" version = "0.1.11" authors = ["Alex Crichton "] build = "build.rs" links = "bzip2" description = "Bindings to libbzip2 for bzip2 compression and decompression exposed as\nReader/Writer streams.\n" homepage = "https://github.com/alexcrichton/bzip2-rs" documentation = "https://docs.rs/bzip2-sys" categories = ["external-ffi-bindings"] license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/bzip2-rs" [lib] name = "bzip2_sys" path = "lib.rs" [dependencies.libc] version = "0.2" [build-dependencies.cc] version = "1.0" [build-dependencies.pkg-config] version = "0.3.9" [features] static = [] cargo_toml_edit-0.0.2/tests/data/chrono-0.4.31.Cargo.toml000064400000000000000000000054721046102023000210010ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.57.0" name = "chrono" version = "0.4.31" exclude = ["/ci/*"] description = "Date and time library for Rust" homepage = "https://github.com/chronotope/chrono" documentation = "https://docs.rs/chrono/" readme = "README.md" keywords = [ "date", "time", "calendar", ] categories = ["date-and-time"] license = "MIT OR Apache-2.0" repository = "https://github.com/chronotope/chrono" [package.metadata.docs.rs] features = ["serde"] rustdoc-args = [ "--cfg", "docsrs", ] [package.metadata.playground] features = ["serde"] [lib] name = "chrono" [dependencies.arbitrary] version = "1.0.0" features = ["derive"] optional = true [dependencies.num-traits] version = "0.2" default-features = false [dependencies.pure-rust-locales] version = "0.7" optional = true [dependencies.rkyv] version = "0.7" optional = true [dependencies.rustc-serialize] version = "0.3.20" optional = true [dependencies.serde] version = "1.0.99" optional = true default-features = false [dev-dependencies.bincode] version = "1.3.0" [dev-dependencies.serde_derive] version = "1" default-features = false [dev-dependencies.serde_json] version = "1" [features] __internal_bench = [] alloc = [] clock = [ "std", "winapi", "iana-time-zone", "android-tzdata", ] default = [ "clock", "std", "oldtime", "wasmbind", ] libc = [] oldtime = [] std = [] unstable-locales = [ "pure-rust-locales", "alloc", ] wasmbind = [ "wasm-bindgen", "js-sys", ] winapi = ["windows-targets"] [target."cfg(all(target_arch = \"wasm32\", not(any(target_os = \"emscripten\", target_os = \"wasi\"))))".dependencies.js-sys] version = "0.3" optional = true [target."cfg(all(target_arch = \"wasm32\", not(any(target_os = \"emscripten\", target_os = \"wasi\"))))".dependencies.wasm-bindgen] version = "0.2" optional = true [target."cfg(all(target_arch = \"wasm32\", not(any(target_os = \"emscripten\", target_os = \"wasi\"))))".dev-dependencies.wasm-bindgen-test] version = "0.3" [target."cfg(target_os = \"android\")".dependencies.android-tzdata] version = "0.1.1" optional = true [target."cfg(unix)".dependencies.iana-time-zone] version = "0.1.45" features = ["fallback"] optional = true [target."cfg(windows)".dependencies.windows-targets] version = "0.48" optional = true [target."cfg(windows)".dev-dependencies.windows-bindgen] version = "0.51" cargo_toml_edit-0.0.2/tests/data/chrono-0.4.31.Cargo.toml.patched000064400000000000000000000040061046102023000224000ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.57.0" name = "chrono" version = "0.4.31" exclude = ["/ci/*"] description = "Date and time library for Rust" homepage = "https://github.com/chronotope/chrono" documentation = "https://docs.rs/chrono/" readme = "README.md" keywords = [ "date", "time", "calendar", ] categories = ["date-and-time"] license = "MIT OR Apache-2.0" repository = "https://github.com/chronotope/chrono" [package.metadata.docs.rs] features = ["serde"] rustdoc-args = [ "--cfg", "docsrs", ] [package.metadata.playground] features = ["serde"] [lib] name = "chrono" [dependencies.arbitrary] version = "1.0.0" features = ["derive"] optional = true [dependencies.num-traits] version = "0.2" default-features = false [dependencies.pure-rust-locales] version = "0.7" optional = true [dependencies.rkyv] version = "0.7" optional = true [dependencies.rustc-serialize] version = "0.3.20" optional = true [dependencies.serde] version = "1.0.99" optional = true default-features = false [dev-dependencies.bincode] version = "1.3.0" [dev-dependencies.serde_derive] version = "1" default-features = false [dev-dependencies.serde_json] version = "1" [features] __internal_bench = [] alloc = [] clock = [ "std", "winapi", "iana-time-zone", ] default = [ "clock", "std", "oldtime", "wasmbind", ] libc = [] oldtime = [] std = [] unstable-locales = [ "pure-rust-locales", "alloc", ] wasmbind = [ ] winapi = [] [target."cfg(unix)".dependencies.iana-time-zone] version = "0.1.45" features = ["fallback"] optional = true cargo_toml_edit-0.0.2/tests/data/cpufeatures-0.2.9.Cargo.toml000064400000000000000000000023771046102023000217630ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "cpufeatures" version = "0.2.9" authors = ["RustCrypto Developers"] description = """ Lightweight runtime CPU feature detection for x86/x86_64 and aarch64 with no_std support and support for mobile targets including Android and iOS """ documentation = "https://docs.rs/cpufeatures" readme = "README.md" keywords = [ "cpuid", "target-feature", ] categories = [ "hardware-support", "no-std", ] license = "MIT OR Apache-2.0" repository = "https://github.com/RustCrypto/utils" [target.aarch64-linux-android.dependencies.libc] version = "0.2.95" [target."cfg(all(target_arch = \"aarch64\", target_os = \"linux\"))".dependencies.libc] version = "0.2.95" [target."cfg(all(target_arch = \"aarch64\", target_vendor = \"apple\"))".dependencies.libc] version = "0.2.95" cargo_toml_edit-0.0.2/tests/data/cpufeatures-0.2.9.Cargo.toml.patched000064400000000000000000000021121046102023000233550ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "cpufeatures" version = "0.2.9" authors = ["RustCrypto Developers"] description = """ Lightweight runtime CPU feature detection for x86/x86_64 and aarch64 with no_std support and support for mobile targets including Android and iOS """ documentation = "https://docs.rs/cpufeatures" readme = "README.md" keywords = [ "cpuid", "target-feature", ] categories = [ "hardware-support", "no-std", ] license = "MIT OR Apache-2.0" repository = "https://github.com/RustCrypto/utils" [target."cfg(all(target_arch = \"aarch64\", target_os = \"linux\"))".dependencies.libc] version = "0.2.95" cargo_toml_edit-0.0.2/tests/data/curl-sys-0.4.66.Cargo.toml000064400000000000000000000037631046102023000213030ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "curl-sys" version = "0.4.66+curl-8.3.0" authors = ["Alex Crichton "] build = "build.rs" links = "curl" description = "Native bindings to the libcurl library" documentation = "https://docs.rs/curl-sys" categories = ["external-ffi-bindings"] license = "MIT" repository = "https://github.com/alexcrichton/curl-rust" [lib] name = "curl_sys" path = "lib.rs" [dependencies.libc] version = "0.2.2" [dependencies.libnghttp2-sys] version = "0.1.3" optional = true [dependencies.libz-sys] version = "1.0.18" features = ["libc"] default-features = false [dependencies.rustls-ffi] version = "0.8" features = ["no_log_capture"] optional = true [build-dependencies.cc] version = "1.0" [build-dependencies.pkg-config] version = "0.3.3" [features] default = ["ssl"] force-system-lib-on-osx = [] http2 = ["libnghttp2-sys"] mesalink = [] ntlm = [] poll_7_68_0 = [] protocol-ftp = [] rustls = ["rustls-ffi"] spnego = [] ssl = ["openssl-sys"] static-curl = [] static-ssl = ["openssl-sys/vendored"] upkeep_7_62_0 = [] windows-static-ssl = [] zlib-ng-compat = [ "libz-sys/zlib-ng", "static-curl", ] [target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-sys] version = "0.9.64" optional = true [target."cfg(target_env = \"msvc\")".build-dependencies.vcpkg] version = "0.2" [target."cfg(windows)".dependencies.windows-sys] version = "0.48" features = ["Win32_Networking_WinSock"] [badges.appveyor] repository = "alexcrichton/curl-rust" [badges.travis-ci] repository = "alexcrichton/curl-rust" cargo_toml_edit-0.0.2/tests/data/curl-sys-0.4.66.Cargo.toml.patched000064400000000000000000000037501046102023000227060ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "curl-sys" version = "0.4.66" authors = ["Alex Crichton "] build = "build.rs" links = "curl" description = "Native bindings to the libcurl library" documentation = "https://docs.rs/curl-sys" categories = ["external-ffi-bindings"] license = "MIT" repository = "https://github.com/alexcrichton/curl-rust" [lib] name = "curl_sys" path = "lib.rs" [dependencies.libc] version = "0.2.2" [dependencies.libnghttp2-sys] version = "0.1.3" optional = true [dependencies.libz-sys] version = "1.0.18" features = ["libc"] default-features = false [dependencies.rustls-ffi] version = "0.8" features = ["no_log_capture"] optional = true [build-dependencies.cc] version = "1.0" [build-dependencies.pkg-config] version = "0.3.3" [features] default = ["ssl"] force-system-lib-on-osx = [] http2 = ["libnghttp2-sys"] mesalink = [] ntlm = [] poll_7_68_0 = [] protocol-ftp = [] rustls = ["rustls-ffi"] spnego = [] ssl = ["openssl-sys"] static-curl = [] static-ssl = ["openssl-sys/vendored"] upkeep_7_62_0 = [] windows-static-ssl = [] zlib-ng-compat = [ "libz-sys/zlib-ng", "static-curl", ] [target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-sys] version = "0.9.64" optional = true [target."cfg(target_env = \"msvc\")".build-dependencies.vcpkg] version = "0.2" [target."cfg(windows)".dependencies.windows-sys] version = "0.48" features = ["Win32_Networking_WinSock"] [badges.appveyor] repository = "alexcrichton/curl-rust" [badges.travis-ci] repository = "alexcrichton/curl-rust" cargo_toml_edit-0.0.2/tests/data/gst-plugin-gtk4-0.11.0.Cargo.toml000064400000000000000000000065731046102023000224460ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "gst-plugin-gtk4" version = "0.11.0" authors = [ "Bilal Elmoussaoui ", "Jordan Petridis ", "Sebastian Dröge ", ] description = "GStreamer GTK 4 Sink element and Paintable widget" readme = "README.md" license = "MPL-2.0" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" [package.metadata.capi] min_version = "0.9.21" [package.metadata.capi.header] enabled = false [package.metadata.capi.library] import_library = false install_subdir = "gstreamer-1.0" versioning = false [package.metadata.capi.pkg_config] requires_private = "gstreamer-1.0, gstreamer-base-1.0, gstreamer-video-1.0, gtk4, gobject-2.0, glib-2.0, gmodule-2.0" [lib] name = "gstgtk4" crate-type = [ "cdylib", "rlib", ] path = "src/lib.rs" [dependencies.gdk_wayland] version = "0.7" features = ["v4_4"] optional = true package = "gdk4-wayland" [dependencies.gdk_x11] version = "0.7" features = ["v4_4"] optional = true package = "gdk4-x11" [dependencies.gst] version = "0.21" features = ["v1_16"] package = "gstreamer" [dependencies.gst_base] version = "0.21" package = "gstreamer-base" [dependencies.gst_gl] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl" [dependencies.gst_gl_egl] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl-egl" [dependencies.gst_gl_wayland] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl-wayland" [dependencies.gst_gl_x11] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl-x11" [dependencies.gst_video] version = "0.21" package = "gstreamer-video" [dependencies.gtk] version = "0.7" package = "gtk4" [build-dependencies.gst-plugin-version-helper] version = "0.7" [features] capi = [] default = [] doc = ["gst/v1_18"] static = [] wayland = [ "gtk/v4_6", "gdk_wayland", "gst_gl", "gst_gl_wayland", ] winegl = [ "gdk_win32/egl", "gst_gl_egl", ] x11egl = [ "gtk/v4_6", "gdk_x11", "gst_gl", "gst_gl_egl", ] x11glx = [ "gtk/v4_6", "gdk_x11", "gst_gl", "gst_gl_x11", ] [target."cfg(target_os = \"macos\")".dependencies.gst_gl] version = "0.21" features = ["v1_16"] package = "gstreamer-gl" [target."cfg(target_os = \"macos\")".dependencies.gtk] version = "0.7" features = ["v4_6"] package = "gtk4" [target."cfg(target_os = \"windows\")".dependencies.gdk_win32] version = "0.7" features = ["v4_4"] package = "gdk4-win32" [target."cfg(target_os = \"windows\")".dependencies.gst_gl] version = "0.21" features = ["v1_20"] package = "gstreamer-gl" [target."cfg(target_os = \"windows\")".dependencies.gtk] version = "0.7" features = ["v4_6"] package = "gtk4" [target."cfg(target_os = \"windows\")".dependencies.windows-sys] version = "0.48" features = [ "Win32_Graphics_OpenGL", "Win32_Foundation", "Win32_Graphics_Gdi", ] cargo_toml_edit-0.0.2/tests/data/gst-plugin-gtk4-0.11.0.Cargo.toml.patched000064400000000000000000000051501046102023000240430ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "gst-plugin-gtk4" version = "0.11.0" authors = [ "Bilal Elmoussaoui ", "Jordan Petridis ", "Sebastian Dröge ", ] description = "GStreamer GTK 4 Sink element and Paintable widget" readme = "README.md" license = "MPL-2.0" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" [package.metadata.capi] min_version = "0.9.21" [package.metadata.capi.header] enabled = false [package.metadata.capi.library] import_library = false install_subdir = "gstreamer-1.0" versioning = false [package.metadata.capi.pkg_config] requires_private = "gstreamer-1.0, gstreamer-base-1.0, gstreamer-video-1.0, gtk4, gobject-2.0, glib-2.0, gmodule-2.0" [lib] name = "gstgtk4" crate-type = [ "cdylib", "rlib", ] path = "src/lib.rs" [dependencies.gdk_wayland] version = "0.7" features = ["v4_4"] optional = true package = "gdk4-wayland" [dependencies.gdk_x11] version = "0.7" features = ["v4_4"] optional = true package = "gdk4-x11" [dependencies.gst] version = "0.21" features = ["v1_16"] package = "gstreamer" [dependencies.gst_base] version = "0.21" package = "gstreamer-base" [dependencies.gst_gl] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl" [dependencies.gst_gl_egl] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl-egl" [dependencies.gst_gl_wayland] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl-wayland" [dependencies.gst_gl_x11] version = "0.21" features = ["v1_16"] optional = true package = "gstreamer-gl-x11" [dependencies.gst_video] version = "0.21" package = "gstreamer-video" [dependencies.gtk] version = "0.7" package = "gtk4" [build-dependencies.gst-plugin-version-helper] version = "0.7" [features] capi = [] default = [] doc = ["gst/v1_18"] static = [] wayland = [ "gtk/v4_6", "gdk_wayland", "gst_gl", "gst_gl_wayland", ] winegl = [ "gst_gl_egl", ] x11egl = [ "gtk/v4_6", "gdk_x11", "gst_gl", "gst_gl_egl", ] x11glx = [ "gtk/v4_6", "gdk_x11", "gst_gl", "gst_gl_x11", ] cargo_toml_edit-0.0.2/tests/data/indicatif-0.17.7.Cargo.toml000064400000000000000000000043201046102023000214410ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.63" name = "indicatif" version = "0.17.7" exclude = ["screenshots/*"] description = "A progress bar and cli reporting library for Rust" documentation = "https://docs.rs/indicatif" readme = "README.md" keywords = [ "cli", "progress", "pb", "colors", "progressbar", ] categories = ["command-line-interface"] license = "MIT" repository = "https://github.com/console-rs/indicatif" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", ] [dependencies.console] version = "0.15" features = ["ansi-parsing"] default-features = false [dependencies.futures-core] version = "0.3" optional = true default-features = false [dependencies.number_prefix] version = "0.4" [dependencies.portable-atomic] version = "1.0.0" [dependencies.rayon] version = "1.1" optional = true [dependencies.tokio] version = "1" features = ["io-util"] optional = true [dependencies.unicode-segmentation] version = "1" optional = true [dependencies.unicode-width] version = "0.1" optional = true [dependencies.vt100] version = "0.15.1" optional = true [dev-dependencies.clap] version = "4" features = [ "color", "derive", ] [dev-dependencies.futures] version = "0.3" [dev-dependencies.once_cell] version = "1" [dev-dependencies.pretty_assertions] version = "1.4.0" [dev-dependencies.rand] version = "0.8" [dev-dependencies.tokio] version = "1" features = [ "fs", "time", "rt", ] [features] default = [ "unicode-width", "console/unicode-width", ] futures = ["dep:futures-core"] improved_unicode = [ "unicode-segmentation", "unicode-width", "console/unicode-width", ] in_memory = ["vt100"] [target."cfg(target_arch = \"wasm32\")".dependencies.instant] version = "0.1" cargo_toml_edit-0.0.2/tests/data/indicatif-0.17.7.Cargo.toml.patched000064400000000000000000000042011046102023000230460ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.63" name = "indicatif" version = "0.17.7" exclude = ["screenshots/*"] description = "A progress bar and cli reporting library for Rust" documentation = "https://docs.rs/indicatif" readme = "README.md" keywords = [ "cli", "progress", "pb", "colors", "progressbar", ] categories = ["command-line-interface"] license = "MIT" repository = "https://github.com/console-rs/indicatif" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", ] [dependencies.console] version = "0.15" features = ["ansi-parsing"] default-features = false [dependencies.futures-core] version = "0.3" optional = true default-features = false [dependencies.number_prefix] version = "0.4" [dependencies.portable-atomic] version = "1.0.0" [dependencies.rayon] version = "1.1" optional = true [dependencies.tokio] version = "1" features = ["io-util"] optional = true [dependencies.unicode-segmentation] version = "1" optional = true [dependencies.unicode-width] version = "0.1" optional = true [dependencies.vt100] version = "0.15.1" optional = true [dev-dependencies.clap] version = "4" features = [ "color", "derive", ] [dev-dependencies.futures] version = "0.3" [dev-dependencies.once_cell] version = "1" [dev-dependencies.pretty_assertions] version = "1.4.0" [dev-dependencies.rand] version = "0.8" [dev-dependencies.tokio] version = "1" features = [ "fs", "time", "rt", ] [features] default = [ "unicode-width", "console/unicode-width", ] futures = ["dep:futures-core"] improved_unicode = [ "unicode-segmentation", "unicode-width", "console/unicode-width", ] in_memory = ["vt100"] cargo_toml_edit-0.0.2/tests/data/libgit2-sys-0.16.1.Cargo.toml000064400000000000000000000030771046102023000216600ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "libgit2-sys" version = "0.16.1+1.7.1" authors = [ "Josh Triplett ", "Alex Crichton ", ] build = "build.rs" links = "git2" exclude = [ "libgit2/ci/*", "libgit2/docs/*", "libgit2/examples/*", "libgit2/fuzzers/*", "libgit2/tests/*", ] description = "Native bindings to the libgit2 library" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/git2-rs" [lib] name = "libgit2_sys" path = "lib.rs" [dependencies.libc] version = "0.2" [dependencies.libssh2-sys] version = "0.3.0" optional = true [dependencies.libz-sys] version = "1.1.0" features = ["libc"] default-features = false [build-dependencies.cc] version = "1.0.43" features = ["parallel"] [build-dependencies.pkg-config] version = "0.3.15" [features] https = ["openssl-sys"] ssh = ["libssh2-sys"] ssh_key_from_memory = [] vendored = [] vendored-openssl = ["openssl-sys/vendored"] zlib-ng-compat = [ "libz-sys/zlib-ng", "libssh2-sys?/zlib-ng-compat", ] [target."cfg(unix)".dependencies.openssl-sys] version = "0.9.45" optional = true cargo_toml_edit-0.0.2/tests/data/libgit2-sys-0.16.1.Cargo.toml.patched000064400000000000000000000030711046102023000232610ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "libgit2-sys" version = "0.16.1" authors = [ "Josh Triplett ", "Alex Crichton ", ] build = "build.rs" links = "git2" exclude = [ "libgit2/ci/*", "libgit2/docs/*", "libgit2/examples/*", "libgit2/fuzzers/*", "libgit2/tests/*", ] description = "Native bindings to the libgit2 library" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/git2-rs" [lib] name = "libgit2_sys" path = "lib.rs" [dependencies.libc] version = "0.2" [dependencies.libssh2-sys] version = "0.3.0" optional = true [dependencies.libz-sys] version = "1.1.0" features = ["libc"] default-features = false [build-dependencies.cc] version = "1.0.43" features = ["parallel"] [build-dependencies.pkg-config] version = "0.3.15" [features] https = ["openssl-sys"] ssh = ["libssh2-sys"] ssh_key_from_memory = [] vendored = [] vendored-openssl = ["openssl-sys/vendored"] zlib-ng-compat = [ "libz-sys/zlib-ng", "libssh2-sys?/zlib-ng-compat", ] [target."cfg(unix)".dependencies.openssl-sys] version = "0.9.45" optional = true cargo_toml_edit-0.0.2/tests/data/native-tls-0.2.11.Cargo.toml000064400000000000000000000042061046102023000215650ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] name = "native-tls" version = "0.2.11" authors = ["Steven Fackler "] description = "A wrapper over a platform's native TLS implementation" readme = "README.md" license = "MIT/Apache-2.0" repository = "https://github.com/sfackler/rust-native-tls" [package.metadata.docs.rs] features = ["alpn"] rustdoc-args = [ "--cfg", "docsrs", ] [dev-dependencies.tempfile] version = "3.0" [dev-dependencies.test-cert-gen] version = "0.7" [features] alpn = ["security-framework/alpn"] vendored = ["openssl/vendored"] [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.lazy_static] version = "1.4.0" [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.libc] version = "0.2" [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.security-framework] version = "2.0.0" [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.security-framework-sys] version = "2.0.0" [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.tempfile] version = "3.1.0" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.log] version = "0.4.5" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.openssl] version = "0.10.29" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.openssl-probe] version = "0.1" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.openssl-sys] version = "0.9.55" [target."cfg(target_os = \"windows\")".dependencies.schannel] version = "0.1.17" cargo_toml_edit-0.0.2/tests/data/native-tls-0.2.11.Cargo.toml.patched000064400000000000000000000027711046102023000232010ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] name = "native-tls" version = "0.2.11" authors = ["Steven Fackler "] description = "A wrapper over a platform's native TLS implementation" readme = "README.md" license = "MIT/Apache-2.0" repository = "https://github.com/sfackler/rust-native-tls" [package.metadata.docs.rs] features = ["alpn"] rustdoc-args = [ "--cfg", "docsrs", ] [dev-dependencies.tempfile] version = "3.0" [dev-dependencies.test-cert-gen] version = "0.7" [features] alpn = [] vendored = ["openssl/vendored"] [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.log] version = "0.4.5" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.openssl] version = "0.10.29" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.openssl-probe] version = "0.1" [target."cfg(not(any(target_os = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.openssl-sys] version = "0.9.55" cargo_toml_edit-0.0.2/tests/data/nix-0.27.1.Cargo.toml000064400000000000000000000053361046102023000203100ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.65" name = "nix" version = "0.27.1" authors = ["The nix-rust Project Developers"] include = [ "src/**/*", "test/**/*", "LICENSE", "README.md", "CHANGELOG.md", ] description = "Rust friendly bindings to *nix APIs" readme = "README.md" categories = ["os::unix-apis"] license = "MIT" repository = "https://github.com/nix-rust/nix" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", ] targets = [ "x86_64-unknown-linux-gnu", "aarch64-linux-android", "x86_64-apple-darwin", "aarch64-apple-ios", "x86_64-unknown-freebsd", "x86_64-unknown-openbsd", "x86_64-unknown-netbsd", "x86_64-unknown-dragonfly", "x86_64-fuchsia", "x86_64-unknown-redox", "x86_64-unknown-illumos", ] [[test]] name = "test" path = "test/test.rs" [[test]] name = "test-aio-drop" path = "test/sys/test_aio_drop.rs" [[test]] name = "test-clearenv" path = "test/test_clearenv.rs" [[test]] name = "test-mount" path = "test/test_mount.rs" harness = false [[test]] name = "test-prctl" path = "test/sys/test_prctl.rs" [dependencies.bitflags] version = "2.3.1" [dependencies.cfg-if] version = "1.0" [dependencies.libc] version = "0.2.147" features = ["extra_traits"] [dependencies.memoffset] version = "0.9" optional = true [dependencies.pin-utils] version = "0.1.0" optional = true [dev-dependencies.assert-impl] version = "0.1" [dev-dependencies.parking_lot] version = "0.12" [dev-dependencies.rand] version = "0.8" [dev-dependencies.semver] version = "1.0.7" [dev-dependencies.tempfile] version = "3.7.1" [features] acct = [] aio = ["pin-utils"] default = [] dir = ["fs"] env = [] event = [] feature = [] fs = [] hostname = [] inotify = [] ioctl = [] kmod = [] mman = [] mount = ["uio"] mqueue = ["fs"] net = ["socket"] personality = [] poll = [] process = [] pthread = [] ptrace = ["process"] quota = [] reboot = [] resource = [] sched = ["process"] signal = ["process"] socket = ["memoffset"] term = [] time = [] ucontext = ["signal"] uio = [] user = ["feature"] zerocopy = [ "fs", "uio", ] [target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] version = "0.5.3" [target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl] version = "0.4" cargo_toml_edit-0.0.2/tests/data/nix-0.27.1.Cargo.toml.patched000064400000000000000000000052151046102023000217130ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.65" name = "nix" version = "0.27.1" authors = ["The nix-rust Project Developers"] include = [ "src/**/*", "test/**/*", "LICENSE", "README.md", "CHANGELOG.md", ] description = "Rust friendly bindings to *nix APIs" readme = "README.md" categories = ["os::unix-apis"] license = "MIT" repository = "https://github.com/nix-rust/nix" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", ] targets = [ "x86_64-unknown-linux-gnu", "aarch64-linux-android", "x86_64-apple-darwin", "aarch64-apple-ios", "x86_64-unknown-freebsd", "x86_64-unknown-openbsd", "x86_64-unknown-netbsd", "x86_64-unknown-dragonfly", "x86_64-fuchsia", "x86_64-unknown-redox", "x86_64-unknown-illumos", ] [[test]] name = "test" path = "test/test.rs" [[test]] name = "test-aio-drop" path = "test/sys/test_aio_drop.rs" [[test]] name = "test-clearenv" path = "test/test_clearenv.rs" [[test]] name = "test-mount" path = "test/test_mount.rs" harness = false [[test]] name = "test-prctl" path = "test/sys/test_prctl.rs" [dependencies.bitflags] version = "2.3.1" [dependencies.cfg-if] version = "1.0" [dependencies.libc] version = "0.2.147" features = ["extra_traits"] [dependencies.memoffset] version = "0.9" optional = true [dependencies.pin-utils] version = "0.1.0" optional = true [dev-dependencies.assert-impl] version = "0.1" [dev-dependencies.parking_lot] version = "0.12" [dev-dependencies.rand] version = "0.8" [dev-dependencies.semver] version = "1.0.7" [dev-dependencies.tempfile] version = "3.7.1" [features] acct = [] aio = ["pin-utils"] default = [] dir = ["fs"] env = [] event = [] feature = [] fs = [] hostname = [] inotify = [] ioctl = [] kmod = [] mman = [] mount = ["uio"] mqueue = ["fs"] net = ["socket"] personality = [] poll = [] process = [] pthread = [] ptrace = ["process"] quota = [] reboot = [] resource = [] sched = ["process"] signal = ["process"] socket = ["memoffset"] term = [] time = [] ucontext = ["signal"] uio = [] user = ["feature"] zerocopy = [ "fs", "uio", ] [target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] version = "0.5.3" cargo_toml_edit-0.0.2/tests/data/rustix-0.36.8.Cargo.toml000064400000000000000000000152201046102023000210500ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.48" name = "rustix" version = "0.36.8" authors = [ "Dan Gohman ", "Jakub Konka ", ] include = [ "src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md", "benches", ] description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls" documentation = "https://docs.rs/rustix" readme = "README.md" keywords = [ "api", "file", "network", "safe", "syscall", ] categories = [ "os::unix-apis", "date-and-time", "filesystem", "network-programming", ] license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" repository = "https://github.com/bytecodealliance/rustix" [package.metadata.docs.rs] features = ["all-apis"] rustdoc-args = [ "--cfg", "doc_cfg", ] targets = [ "x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", ] [[bench]] name = "mod" harness = false [dependencies.alloc] version = "1.0.0" optional = true package = "rustc-std-workspace-alloc" [dependencies.bitflags] version = "1.2.1" [dependencies.compiler_builtins] version = "0.1.49" optional = true [dependencies.core] version = "1.0.0" optional = true package = "rustc-std-workspace-core" [dependencies.io-lifetimes] version = "1.0.0" features = ["close"] optional = true default-features = false [dependencies.itoa] version = "1.0.1" optional = true default-features = false [dev-dependencies.flate2] version = "1.0" [dev-dependencies.io-lifetimes] version = "1.0.0" features = ["close"] default-features = false [dev-dependencies.libc] version = "0.2.133" [dev-dependencies.libc_errno] version = "0.2.8" default-features = false package = "errno" [dev-dependencies.memoffset] version = "0.7.1" [dev-dependencies.serial_test] version = "0.6" [dev-dependencies.tempfile] version = "3.2.0" [build-dependencies.cc] version = "1.0.68" optional = true [features] all-apis = [ "fs", "io_uring", "mm", "net", "param", "process", "procfs", "rand", "runtime", "termios", "thread", "time", ] all-impls = [ "os_pipe", "fs-err", ] default = [ "std", "use-libc-auxv", ] fs = [] fs-err = ["io-lifetimes/fs-err"] io_uring = [ "fs", "net", ] mm = [] net = [] os_pipe = ["io-lifetimes/os_pipe"] param = ["fs"] process = [] procfs = [ "once_cell", "itoa", "fs", ] rand = [] runtime = [] rustc-dep-of-std = [ "core", "alloc", "compiler_builtins", "linux-raw-sys/rustc-dep-of-std", "bitflags/rustc-dep-of-std", ] std = ["io-lifetimes"] termios = [] thread = [] time = [] use-libc = [ "libc_errno", "libc", ] use-libc-auxv = ["libc"] [target."cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\"))))))))".dependencies.linux-raw-sys] version = "0.1.2" features = [ "general", "no_std", ] default-features = false [target."cfg(all(criterion, not(any(target_os = \"emscripten\", target_os = \"wasi\"))))".dev-dependencies.criterion] version = "0.4" [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))".dependencies.libc] version = "0.2.133" features = ["extra_traits"] optional = true [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))".dependencies.libc_errno] version = "0.2.8" optional = true default-features = false package = "errno" [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))".dependencies.linux-raw-sys] version = "0.1.2" features = [ "general", "errno", "ioctl", "no_std", ] default-features = false [target."cfg(any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))))".dependencies.libc] version = "0.2.133" features = ["extra_traits"] [target."cfg(any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))))".dependencies.libc_errno] version = "0.2.8" default-features = false package = "errno" [target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dependencies.once_cell] version = "1.5.2" optional = true [target."cfg(windows)".dependencies.windows-sys] version = "0.45.0" features = [ "Win32_Foundation", "Win32_Networking_WinSock", "Win32_NetworkManagement_IpHelper", "Win32_System_Threading", ] [target."cfg(windows)".dev-dependencies.ctor] version = "0.1.21" cargo_toml_edit-0.0.2/tests/data/rustix-0.36.8.Cargo.toml.patched000064400000000000000000000143651046102023000224700ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.48" name = "rustix" version = "0.36.8" authors = [ "Dan Gohman ", "Jakub Konka ", ] include = [ "src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md", "benches", ] description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls" documentation = "https://docs.rs/rustix" readme = "README.md" keywords = [ "api", "file", "network", "safe", "syscall", ] categories = [ "os::unix-apis", "date-and-time", "filesystem", "network-programming", ] license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" repository = "https://github.com/bytecodealliance/rustix" [package.metadata.docs.rs] features = ["all-apis"] rustdoc-args = [ "--cfg", "doc_cfg", ] targets = [ "x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", ] [[bench]] name = "mod" harness = false [dependencies.alloc] version = "1.0.0" optional = true package = "rustc-std-workspace-alloc" [dependencies.bitflags] version = "1.2.1" [dependencies.compiler_builtins] version = "0.1.49" optional = true [dependencies.core] version = "1.0.0" optional = true package = "rustc-std-workspace-core" [dependencies.io-lifetimes] version = "1.0.0" features = ["close"] optional = true default-features = false [dependencies.itoa] version = "1.0.1" optional = true default-features = false [dev-dependencies.flate2] version = "1.0" [dev-dependencies.io-lifetimes] version = "1.0.0" features = ["close"] default-features = false [dev-dependencies.libc] version = "0.2.133" [dev-dependencies.libc_errno] version = "0.2.8" default-features = false package = "errno" [dev-dependencies.memoffset] version = "0.7.1" [dev-dependencies.serial_test] version = "0.6" [dev-dependencies.tempfile] version = "3.2.0" [build-dependencies.cc] version = "1.0.68" optional = true [features] all-apis = [ "fs", "io_uring", "mm", "net", "param", "process", "procfs", "rand", "runtime", "termios", "thread", "time", ] all-impls = [ "os_pipe", "fs-err", ] default = [ "std", "use-libc-auxv", ] fs = [] fs-err = ["io-lifetimes/fs-err"] io_uring = [ "fs", "net", ] mm = [] net = [] os_pipe = ["io-lifetimes/os_pipe"] param = ["fs"] process = [] procfs = [ "once_cell", "itoa", "fs", ] rand = [] runtime = [] rustc-dep-of-std = [ "core", "alloc", "compiler_builtins", "linux-raw-sys/rustc-dep-of-std", "bitflags/rustc-dep-of-std", ] std = ["io-lifetimes"] termios = [] thread = [] time = [] use-libc = [ "libc_errno", "libc", ] use-libc-auxv = ["libc"] [target."cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\"))))))))".dependencies.linux-raw-sys] version = "0.1.2" features = [ "general", "no_std", ] default-features = false [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))".dependencies.libc] version = "0.2.133" features = ["extra_traits"] optional = true [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))".dependencies.libc_errno] version = "0.2.8" optional = true default-features = false package = "errno" [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))".dependencies.linux-raw-sys] version = "0.1.2" features = [ "general", "errno", "ioctl", "no_std", ] default-features = false [target."cfg(any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))))".dependencies.libc] version = "0.2.133" features = ["extra_traits"] [target."cfg(any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\")))))))".dependencies.libc_errno] version = "0.2.8" default-features = false package = "errno" [target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dependencies.once_cell] version = "1.5.2" optional = true cargo_toml_edit-0.0.2/tests/data/serde-1.0.196.Cargo.toml000064400000000000000000000031411046102023000206730ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.31" name = "serde" version = "1.0.196" authors = [ "Erick Tryzelaar ", "David Tolnay ", ] build = "build.rs" description = "A generic serialization/deserialization framework" homepage = "https://serde.rs" documentation = "https://docs.rs/serde" readme = "crates-io.md" keywords = [ "serde", "serialization", "no_std", ] categories = [ "encoding", "no-std", "no-std::no-alloc", ] license = "MIT OR Apache-2.0" repository = "https://github.com/serde-rs/serde" [package.metadata.docs.rs] features = [ "derive", "rc", "unstable", ] rustdoc-args = [ "--cfg", "doc_cfg", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [package.metadata.playground] features = [ "derive", "rc", ] [lib] doc-scrape-examples = false [dependencies.serde_derive] version = "1" optional = true [dev-dependencies.serde_derive] version = "1" [features] alloc = [] default = ["std"] derive = ["serde_derive"] rc = [] std = [] unstable = [] [target."cfg(any())".dependencies.serde_derive] version = "=1.0.196" cargo_toml_edit-0.0.2/tests/data/serde-1.0.196.Cargo.toml.patched000064400000000000000000000031411046102023000223020ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.31" name = "serde" version = "1.0.196" authors = [ "Erick Tryzelaar ", "David Tolnay ", ] build = "build.rs" description = "A generic serialization/deserialization framework" homepage = "https://serde.rs" documentation = "https://docs.rs/serde" readme = "crates-io.md" keywords = [ "serde", "serialization", "no_std", ] categories = [ "encoding", "no-std", "no-std::no-alloc", ] license = "MIT OR Apache-2.0" repository = "https://github.com/serde-rs/serde" [package.metadata.docs.rs] features = [ "derive", "rc", "unstable", ] rustdoc-args = [ "--cfg", "doc_cfg", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [package.metadata.playground] features = [ "derive", "rc", ] [lib] doc-scrape-examples = false [dependencies.serde_derive] version = "1" optional = true [dev-dependencies.serde_derive] version = "1" [features] alloc = [] default = ["std"] derive = ["serde_derive"] rc = [] std = [] unstable = [] [target."cfg(any())".dependencies.serde_derive] version = "=1.0.196" cargo_toml_edit-0.0.2/tests/data/syn-2.0.34.Cargo.toml000064400000000000000000000051661046102023000203230ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.56" name = "syn" version = "2.0.34" authors = ["David Tolnay "] include = [ "/benches/**", "/Cargo.toml", "/LICENSE-APACHE", "/LICENSE-MIT", "/README.md", "/src/**", "/tests/**", ] description = "Parser for Rust source code" documentation = "https://docs.rs/syn" readme = "README.md" keywords = [ "macros", "syn", ] categories = [ "development-tools::procedural-macro-helpers", "parser-implementations", ] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/syn" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "doc_cfg", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [package.metadata.playground] features = [ "full", "visit", "visit-mut", "fold", "extra-traits", ] [lib] doc-scrape-examples = false [[bench]] name = "rust" harness = false required-features = [ "full", "parsing", ] [[bench]] name = "file" required-features = [ "full", "parsing", ] [dependencies.proc-macro2] version = "1.0.67" default-features = false [dependencies.quote] version = "1.0.28" optional = true default-features = false [dependencies.unicode-ident] version = "1" [dev-dependencies.anyhow] version = "1" [dev-dependencies.automod] version = "1" [dev-dependencies.flate2] version = "1" [dev-dependencies.insta] version = "1" [dev-dependencies.rayon] version = "1" [dev-dependencies.ref-cast] version = "1" [dev-dependencies.regex] version = "1" [dev-dependencies.reqwest] version = "0.11" features = ["blocking"] [dev-dependencies.rustversion] version = "1" [dev-dependencies.syn-test-suite] version = "0" [dev-dependencies.tar] version = "0.4.16" [dev-dependencies.termcolor] version = "1" [dev-dependencies.walkdir] version = "2.3.2" [features] clone-impls = [] default = [ "derive", "parsing", "printing", "clone-impls", "proc-macro", ] derive = [] extra-traits = [] fold = [] full = [] parsing = [] printing = ["quote"] proc-macro = [ "proc-macro2/proc-macro", "quote/proc-macro", ] test = ["syn-test-suite/all-features"] visit = [] visit-mut = [] cargo_toml_edit-0.0.2/tests/data/syn-2.0.34.Cargo.toml.patched000064400000000000000000000051661046102023000217320ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.56" name = "syn" version = "2.0.34" authors = ["David Tolnay "] include = [ "/benches/**", "/Cargo.toml", "/LICENSE-APACHE", "/LICENSE-MIT", "/README.md", "/src/**", "/tests/**", ] description = "Parser for Rust source code" documentation = "https://docs.rs/syn" readme = "README.md" keywords = [ "macros", "syn", ] categories = [ "development-tools::procedural-macro-helpers", "parser-implementations", ] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/syn" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "doc_cfg", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [package.metadata.playground] features = [ "full", "visit", "visit-mut", "fold", "extra-traits", ] [lib] doc-scrape-examples = false [[bench]] name = "rust" harness = false required-features = [ "full", "parsing", ] [[bench]] name = "file" required-features = [ "full", "parsing", ] [dependencies.proc-macro2] version = "1.0.67" default-features = false [dependencies.quote] version = "1.0.28" optional = true default-features = false [dependencies.unicode-ident] version = "1" [dev-dependencies.anyhow] version = "1" [dev-dependencies.automod] version = "1" [dev-dependencies.flate2] version = "1" [dev-dependencies.insta] version = "1" [dev-dependencies.rayon] version = "1" [dev-dependencies.ref-cast] version = "1" [dev-dependencies.regex] version = "1" [dev-dependencies.reqwest] version = "0.11" features = ["blocking"] [dev-dependencies.rustversion] version = "1" [dev-dependencies.syn-test-suite] version = "0" [dev-dependencies.tar] version = "0.4.16" [dev-dependencies.termcolor] version = "1" [dev-dependencies.walkdir] version = "2.3.2" [features] clone-impls = [] default = [ "derive", "parsing", "printing", "clone-impls", "proc-macro", ] derive = [] extra-traits = [] fold = [] full = [] parsing = [] printing = ["quote"] proc-macro = [ "proc-macro2/proc-macro", "quote/proc-macro", ] test = ["syn-test-suite/all-features"] visit = [] visit-mut = [] cargo_toml_edit-0.0.2/tests/data/time-0.3.29.Cargo.toml000064400000000000000000000071421046102023000204510ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.67.0" name = "time" version = "0.3.29" authors = [ "Jacob Pratt ", "Time contributors", ] include = [ "src/**/*", "LICENSE-*", "README.md", ] description = "Date and time library. Fully interoperable with the standard library. Mostly compatible with #![no_std]." homepage = "https://time-rs.github.io" readme = "README.md" keywords = [ "date", "time", "calendar", "duration", ] categories = [ "date-and-time", "no-std", "parser-implementations", "value-formatting", ] license = "MIT OR Apache-2.0" repository = "https://github.com/time-rs/time" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "__time_03_docs", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [lib] bench = false [[test]] name = "tests" path = "../tests/main.rs" [[bench]] name = "benchmarks" path = "../benchmarks/main.rs" harness = false [dependencies.deranged] version = "0.3.7" default-features = false [dependencies.itoa] version = "1.0.1" optional = true [dependencies.quickcheck] version = "1.0.3" optional = true default-features = false [dependencies.rand] version = "0.8.4" optional = true default-features = false [dependencies.serde] version = "1.0.184" optional = true default-features = false [dependencies.time-core] version = "=0.1.2" [dependencies.time-macros] version = "=0.2.15" optional = true [dev-dependencies.itertools] version = "0.11.0" [dev-dependencies.quickcheck_macros] version = "1.0.0" [dev-dependencies.rand] version = "0.8.4" default-features = false [dev-dependencies.rstest] version = "0.18.2" default-features = false [dev-dependencies.serde] version = "1.0.184" features = ["derive"] default-features = false [dev-dependencies.serde_json] version = "1.0.68" [dev-dependencies.serde_test] version = "1.0.126" [dev-dependencies.time-macros] version = "=0.2.15" [features] alloc = ["serde?/alloc"] default = ["std"] formatting = [ "dep:itoa", "std", "time-macros?/formatting", ] large-dates = ["time-macros?/large-dates"] local-offset = [ "std", "dep:libc", "dep:num_threads", ] macros = ["dep:time-macros"] parsing = ["time-macros?/parsing"] quickcheck = [ "dep:quickcheck", "alloc", "deranged/quickcheck", ] rand = [ "dep:rand", "deranged/rand", ] serde = [ "dep:serde", "time-macros?/serde", "deranged/serde", ] serde-human-readable = [ "serde", "formatting", "parsing", ] serde-well-known = [ "serde", "formatting", "parsing", ] std = [ "alloc", "deranged/std", ] wasm-bindgen = ["dep:js-sys"] [target."cfg(__ui_tests)".dev-dependencies.trybuild] version = "1.0.68" [target."cfg(all(target_family = \"wasm\", not(any(target_os = \"emscripten\", target_os = \"wasi\"))))".dependencies.js-sys] version = "0.3.58" optional = true [target."cfg(bench)".dev-dependencies.criterion] version = "0.5.1" default-features = false [target."cfg(target_family = \"unix\")".dependencies.libc] version = "0.2.98" optional = true [target."cfg(target_family = \"unix\")".dependencies.num_threads] version = "0.1.2" optional = true cargo_toml_edit-0.0.2/tests/data/time-0.3.29.Cargo.toml.patched000064400000000000000000000064161046102023000220630ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.67.0" name = "time" version = "0.3.29" authors = [ "Jacob Pratt ", "Time contributors", ] include = [ "src/**/*", "LICENSE-*", "README.md", ] description = "Date and time library. Fully interoperable with the standard library. Mostly compatible with #![no_std]." homepage = "https://time-rs.github.io" readme = "README.md" keywords = [ "date", "time", "calendar", "duration", ] categories = [ "date-and-time", "no-std", "parser-implementations", "value-formatting", ] license = "MIT OR Apache-2.0" repository = "https://github.com/time-rs/time" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "__time_03_docs", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [lib] bench = false [[test]] name = "tests" path = "../tests/main.rs" [[bench]] name = "benchmarks" path = "../benchmarks/main.rs" harness = false [dependencies.deranged] version = "0.3.7" default-features = false [dependencies.itoa] version = "1.0.1" optional = true [dependencies.quickcheck] version = "1.0.3" optional = true default-features = false [dependencies.rand] version = "0.8.4" optional = true default-features = false [dependencies.serde] version = "1.0.184" optional = true default-features = false [dependencies.time-core] version = "=0.1.2" [dependencies.time-macros] version = "=0.2.15" optional = true [dev-dependencies.itertools] version = "0.11.0" [dev-dependencies.quickcheck_macros] version = "1.0.0" [dev-dependencies.rand] version = "0.8.4" default-features = false [dev-dependencies.rstest] version = "0.18.2" default-features = false [dev-dependencies.serde] version = "1.0.184" features = ["derive"] default-features = false [dev-dependencies.serde_json] version = "1.0.68" [dev-dependencies.serde_test] version = "1.0.126" [dev-dependencies.time-macros] version = "=0.2.15" [features] alloc = ["serde?/alloc"] default = ["std"] formatting = [ "dep:itoa", "std", "time-macros?/formatting", ] large-dates = ["time-macros?/large-dates"] local-offset = [ "std", "dep:libc", "dep:num_threads", ] macros = ["dep:time-macros"] parsing = ["time-macros?/parsing"] quickcheck = [ "dep:quickcheck", "alloc", "deranged/quickcheck", ] rand = [ "dep:rand", "deranged/rand", ] serde = [ "dep:serde", "time-macros?/serde", "deranged/serde", ] serde-human-readable = [ "serde", "formatting", "parsing", ] serde-well-known = [ "serde", "formatting", "parsing", ] std = [ "alloc", "deranged/std", ] wasm-bindgen = [] [target."cfg(target_family = \"unix\")".dependencies.libc] version = "0.2.98" optional = true [target."cfg(target_family = \"unix\")".dependencies.num_threads] version = "0.1.2" optional = true cargo_toml_edit-0.0.2/tests/data/tokio-1.32.0.Cargo.toml000064400000000000000000000106701046102023000206300ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.63" name = "tokio" version = "1.32.0" authors = ["Tokio Contributors "] description = """ An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications. """ homepage = "https://tokio.rs" readme = "README.md" keywords = [ "io", "async", "non-blocking", "futures", ] categories = [ "asynchronous", "network-programming", ] license = "MIT" repository = "https://github.com/tokio-rs/tokio" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "tokio_unstable", ] rustdoc-args = [ "--cfg", "docsrs", "--cfg", "tokio_unstable", ] [package.metadata.playground] features = [ "full", "test-util", ] [dependencies.bytes] version = "1.0.0" optional = true [dependencies.mio] version = "0.8.6" optional = true default-features = false [dependencies.num_cpus] version = "1.8.0" optional = true [dependencies.parking_lot] version = "0.12.0" optional = true [dependencies.pin-project-lite] version = "0.2.11" [dependencies.tokio-macros] version = "~2.1.0" optional = true [dev-dependencies.async-stream] version = "0.3" [dev-dependencies.futures] version = "0.3.0" features = ["async-await"] [dev-dependencies.mockall] version = "0.11.1" [dev-dependencies.tokio-stream] version = "0.1" [dev-dependencies.tokio-test] version = "0.4.0" [features] default = [] fs = [] full = [ "fs", "io-util", "io-std", "macros", "net", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "sync", "time", ] io-std = [] io-util = ["bytes"] macros = ["tokio-macros"] net = [ "libc", "mio/os-poll", "mio/os-ext", "mio/net", "socket2", "windows-sys/Win32_Foundation", "windows-sys/Win32_Security", "windows-sys/Win32_Storage_FileSystem", "windows-sys/Win32_System_Pipes", "windows-sys/Win32_System_SystemServices", ] process = [ "bytes", "libc", "mio/os-poll", "mio/os-ext", "mio/net", "signal-hook-registry", "windows-sys/Win32_Foundation", "windows-sys/Win32_System_Threading", "windows-sys/Win32_System_WindowsProgramming", ] rt = [] rt-multi-thread = [ "num_cpus", "rt", ] signal = [ "libc", "mio/os-poll", "mio/net", "mio/os-ext", "signal-hook-registry", "windows-sys/Win32_Foundation", "windows-sys/Win32_System_Console", ] stats = [] sync = [] test-util = [ "rt", "sync", "time", ] time = [] [target."cfg(all(target_family = \"wasm\", not(target_os = \"wasi\")))".dev-dependencies.wasm-bindgen-test] version = "0.3.0" [target."cfg(loom)".dev-dependencies.loom] version = "0.7" features = [ "futures", "checkpoint", ] [target."cfg(not(all(target_family = \"wasm\", target_os = \"unknown\")))".dev-dependencies.rand] version = "0.8.0" [target."cfg(not(target_family = \"wasm\"))".dependencies.socket2] version = "0.5.3" features = ["all"] optional = true [target."cfg(not(target_family = \"wasm\"))".dev-dependencies.socket2] version = "0.5.3" [target."cfg(not(target_family = \"wasm\"))".dev-dependencies.tempfile] version = "3.1.0" [target."cfg(target_os = \"freebsd\")".dev-dependencies.mio-aio] version = "0.7.0" features = ["tokio"] [target."cfg(tokio_taskdump)".dependencies.backtrace] version = "0.3.58" [target."cfg(tokio_unstable)".dependencies.tracing] version = "0.1.25" features = ["std"] optional = true default-features = false [target."cfg(unix)".dependencies.libc] version = "0.2.145" optional = true [target."cfg(unix)".dependencies.signal-hook-registry] version = "1.1.1" optional = true [target."cfg(unix)".dev-dependencies.libc] version = "0.2.145" [target."cfg(unix)".dev-dependencies.nix] version = "0.26" features = [ "fs", "socket", ] default-features = false [target."cfg(windows)".dependencies.windows-sys] version = "0.48" optional = true [target."cfg(windows)".dev-dependencies.windows-sys] version = "0.48" features = [ "Win32_Foundation", "Win32_Security_Authorization", ] cargo_toml_edit-0.0.2/tests/data/tokio-1.32.0.Cargo.toml.patched000064400000000000000000000064351046102023000222430ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.63" name = "tokio" version = "1.32.0" authors = ["Tokio Contributors "] description = """ An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications. """ homepage = "https://tokio.rs" readme = "README.md" keywords = [ "io", "async", "non-blocking", "futures", ] categories = [ "asynchronous", "network-programming", ] license = "MIT" repository = "https://github.com/tokio-rs/tokio" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "tokio_unstable", ] rustdoc-args = [ "--cfg", "docsrs", "--cfg", "tokio_unstable", ] [package.metadata.playground] features = [ "full", "test-util", ] [dependencies.bytes] version = "1.0.0" optional = true [dependencies.mio] version = "0.8.6" optional = true default-features = false [dependencies.num_cpus] version = "1.8.0" optional = true [dependencies.parking_lot] version = "0.12.0" optional = true [dependencies.pin-project-lite] version = "0.2.11" [dependencies.tokio-macros] version = "~2.1.0" optional = true [dev-dependencies.async-stream] version = "0.3" [dev-dependencies.futures] version = "0.3.0" features = ["async-await"] [dev-dependencies.mockall] version = "0.11.1" [dev-dependencies.tokio-stream] version = "0.1" [dev-dependencies.tokio-test] version = "0.4.0" [features] default = [] fs = [] full = [ "fs", "io-util", "io-std", "macros", "net", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "sync", "time", ] io-std = [] io-util = ["bytes"] macros = ["tokio-macros"] net = [ "libc", "mio/os-poll", "mio/os-ext", "mio/net", "socket2", ] process = [ "bytes", "libc", "mio/os-poll", "mio/os-ext", "mio/net", "signal-hook-registry", ] rt = [] rt-multi-thread = [ "num_cpus", "rt", ] signal = [ "libc", "mio/os-poll", "mio/net", "mio/os-ext", "signal-hook-registry", ] stats = [] sync = [] test-util = [ "rt", "sync", "time", ] time = [] [target."cfg(not(all(target_family = \"wasm\", target_os = \"unknown\")))".dev-dependencies.rand] version = "0.8.0" [target."cfg(not(target_family = \"wasm\"))".dependencies.socket2] version = "0.5.3" features = ["all"] optional = true [target."cfg(not(target_family = \"wasm\"))".dev-dependencies.socket2] version = "0.5.3" [target."cfg(not(target_family = \"wasm\"))".dev-dependencies.tempfile] version = "3.1.0" [target."cfg(unix)".dependencies.libc] version = "0.2.145" optional = true [target."cfg(unix)".dependencies.signal-hook-registry] version = "1.1.1" optional = true [target."cfg(unix)".dev-dependencies.libc] version = "0.2.145" [target."cfg(unix)".dev-dependencies.nix] version = "0.26" features = [ "fs", "socket", ] default-features = false cargo_toml_edit-0.0.2/tests/data/which-4.4.2.Cargo.toml000064400000000000000000000026021046102023000205250ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.63" name = "which" version = "4.4.2" authors = ["Harry Fei "] description = "A Rust equivalent of Unix command \"which\". Locate installed executable in cross platforms." documentation = "https://docs.rs/which/" readme = "README.md" keywords = [ "which", "which-rs", "unix", "command", ] categories = [ "os", "filesystem", ] license = "MIT" repository = "https://github.com/harryfei/which-rs.git" [package.metadata.docs.rs] all-features = true [dependencies.either] version = "1.6.1" [dependencies.regex] version = "1.5.5" optional = true [dependencies.rustix] version = "0.38.10" features = [ "fs", "std", ] default-features = false [dev-dependencies.tempfile] version = "3.3.0" [target."cfg(any(windows, unix, target_os = \"redox\"))".dependencies.home] version = "0.5.5" [target."cfg(windows)".dependencies.once_cell] version = "1" cargo_toml_edit-0.0.2/tests/data/which-4.4.2.Cargo.toml.patched000064400000000000000000000025041046102023000221350ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.63" name = "which" version = "4.4.2" authors = ["Harry Fei "] description = "A Rust equivalent of Unix command \"which\". Locate installed executable in cross platforms." documentation = "https://docs.rs/which/" readme = "README.md" keywords = [ "which", "which-rs", "unix", "command", ] categories = [ "os", "filesystem", ] license = "MIT" repository = "https://github.com/harryfei/which-rs.git" [package.metadata.docs.rs] all-features = true [dependencies.either] version = "1.6.1" [dependencies.regex] version = "1.5.5" optional = true [dependencies.rustix] version = "0.38.10" features = [ "fs", "std", ] default-features = false [dev-dependencies.tempfile] version = "3.3.0" [target."cfg(any(windows, unix, target_os = \"redox\"))".dependencies.home] version = "0.5.5" cargo_toml_edit-0.0.2/tests/data/wild-2.2.0.Cargo.toml000064400000000000000000000030011046102023000203460ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "wild" version = "2.2.0" authors = ["Kornel "] include = [ "/src/*.rs", "/Cargo.toml", "/LICENSE", "/README.md", ] description = "Glob (wildcard) expanded command-line arguments on Windows" homepage = "https://lib.rs/crates/wild" documentation = "https://docs.rs/wild" readme = "README.md" keywords = [ "wildcards", "glob", "windows", "shell", "CommandLineToArgvW", ] categories = [ "command-line-interface", "os::windows-apis", ] license = "Apache-2.0 OR MIT" repository = "https://gitlab.com/kornelski/wild" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [dev-dependencies.glob] version = "0.3.1" [features] glob-quoted-on-windows = [] [target."cfg(windows)".dependencies.glob] version = "0.3.1" [badges.appveyor] repository = "pornel/wild" [badges.gitlab] repository = "kornelski/wild" [badges.maintenance] status = "passively-maintained" cargo_toml_edit-0.0.2/tests/data/wild-2.2.0.Cargo.toml.patched000064400000000000000000000027041046102023000217660ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "wild" version = "2.2.0" authors = ["Kornel "] include = [ "/src/*.rs", "/Cargo.toml", "/LICENSE", "/README.md", ] description = "Glob (wildcard) expanded command-line arguments on Windows" homepage = "https://lib.rs/crates/wild" documentation = "https://docs.rs/wild" readme = "README.md" keywords = [ "wildcards", "glob", "windows", "shell", "CommandLineToArgvW", ] categories = [ "command-line-interface", "os::windows-apis", ] license = "Apache-2.0 OR MIT" repository = "https://gitlab.com/kornelski/wild" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] [dev-dependencies.glob] version = "0.3.1" [features] glob-quoted-on-windows = [] [badges.appveyor] repository = "pornel/wild" [badges.gitlab] repository = "kornelski/wild" [badges.maintenance] status = "passively-maintained" cargo_toml_edit-0.0.2/tests/data/zbus-3.14.1.Cargo.toml000064400000000000000000000110201046102023000204570ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.64" name = "zbus" version = "3.14.1" authors = ["Zeeshan Ali Khan "] description = "API for D-Bus communication" readme = "README.md" keywords = [ "D-Bus", "DBus", "IPC", ] categories = ["os::unix-apis"] license = "MIT" repository = "https://github.com/dbus2/zbus/" resolver = "2" [package.metadata.docs.rs] all-features = true targets = ["x86_64-unknown-linux-gnu"] [dependencies.async-broadcast] version = "0.5.0" [dependencies.async-executor] version = "1.5.0" optional = true [dependencies.async-fs] version = "1.6.0" optional = true [dependencies.async-io] version = "1.12.0" optional = true [dependencies.async-lock] version = "2.6.0" optional = true [dependencies.async-recursion] version = "1.0.0" [dependencies.async-task] version = "4.3.0" optional = true [dependencies.async-trait] version = "0.1.58" [dependencies.blocking] version = "1.0.2" optional = true [dependencies.byteorder] version = "1.4.3" [dependencies.derivative] version = "2.2" [dependencies.enumflags2] version = "0.7.7" features = ["serde"] [dependencies.event-listener] version = "2.5.3" [dependencies.futures-core] version = "0.3.25" [dependencies.futures-sink] version = "0.3.25" [dependencies.futures-util] version = "0.3.25" features = [ "sink", "std", ] default-features = false [dependencies.hex] version = "0.4.3" [dependencies.once_cell] version = "1.4.0" [dependencies.ordered-stream] version = "0.2" [dependencies.quick-xml] version = "0.27.1" features = [ "serialize", "overlapped-lists", ] optional = true [dependencies.rand] version = "0.8.5" [dependencies.serde] version = "1.0" features = ["derive"] [dependencies.serde-xml-rs] version = "0.4.1" optional = true [dependencies.serde_repr] version = "0.1.9" [dependencies.sha1] version = "0.10.5" features = ["std"] [dependencies.static_assertions] version = "1.1.0" [dependencies.tokio] version = "1.21.2" features = [ "rt", "net", "time", "fs", "io-util", "process", "sync", "tracing", ] optional = true [dependencies.tokio-vsock] version = "0.3.3" optional = true [dependencies.tracing] version = "0.1.37" [dependencies.vsock] version = "0.3.0" optional = true [dependencies.xdg-home] version = "1.0.0" [dependencies.zbus_macros] version = "=3.14.1" [dependencies.zbus_names] version = "2.6" [dependencies.zvariant] version = "3.15.0" features = ["enumflags2"] default-features = false [dev-dependencies.async-std] version = "1.12.0" features = ["attributes"] [dev-dependencies.doc-comment] version = "0.3.3" [dev-dependencies.futures-util] version = "0.3.25" [dev-dependencies.ntest] version = "0.9.0" [dev-dependencies.tempfile] version = "3.3.0" [dev-dependencies.test-log] version = "0.2.11" features = ["trace"] default-features = false [dev-dependencies.tokio] version = "1" features = [ "macros", "rt-multi-thread", "fs", "io-util", "net", "sync", ] [dev-dependencies.tracing-subscriber] version = "0.3.16" features = [ "env-filter", "fmt", "ansi", ] default-features = false [features] async-io = [ "dep:async-io", "async-executor", "async-task", "async-lock", "async-fs", "blocking", "futures-util/io", ] chrono = ["zvariant/chrono"] default = ["async-io"] gvariant = ["zvariant/gvariant"] time = ["zvariant/time"] tokio = ["dep:tokio"] tokio-vsock = [ "dep:tokio-vsock", "tokio", ] url = ["zvariant/url"] uuid = ["zvariant/uuid"] vsock = [ "dep:vsock", "dep:async-io", ] windows-gdbus = [] xml = ["serde-xml-rs"] [target."cfg(target_os = \"macos\")".dependencies.async-process] version = "1.7.0" [target."cfg(unix)".dependencies.nix] version = "0.26.0" features = [ "socket", "uio", ] default-features = false [target."cfg(windows)".dependencies.uds_windows] version = "1.0.2" [target."cfg(windows)".dependencies.winapi] version = "0.3" features = [ "handleapi", "iphlpapi", "memoryapi", "processthreadsapi", "sddl", "securitybaseapi", "synchapi", "tcpmib", "winbase", "winerror", "winsock2", ] cargo_toml_edit-0.0.2/tests/data/zbus-3.14.1.Cargo.toml.patched000064400000000000000000000101611046102023000220730ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.64" name = "zbus" version = "3.14.1" authors = ["Zeeshan Ali Khan "] description = "API for D-Bus communication" readme = "README.md" keywords = [ "D-Bus", "DBus", "IPC", ] categories = ["os::unix-apis"] license = "MIT" repository = "https://github.com/dbus2/zbus/" resolver = "2" [package.metadata.docs.rs] all-features = true targets = ["x86_64-unknown-linux-gnu"] [dependencies.async-broadcast] version = "0.5.0" [dependencies.async-executor] version = "1.5.0" optional = true [dependencies.async-fs] version = "1.6.0" optional = true [dependencies.async-io] version = "1.12.0" optional = true [dependencies.async-lock] version = "2.6.0" optional = true [dependencies.async-recursion] version = "1.0.0" [dependencies.async-task] version = "4.3.0" optional = true [dependencies.async-trait] version = "0.1.58" [dependencies.blocking] version = "1.0.2" optional = true [dependencies.byteorder] version = "1.4.3" [dependencies.derivative] version = "2.2" [dependencies.enumflags2] version = "0.7.7" features = ["serde"] [dependencies.event-listener] version = "2.5.3" [dependencies.futures-core] version = "0.3.25" [dependencies.futures-sink] version = "0.3.25" [dependencies.futures-util] version = "0.3.25" features = [ "sink", "std", ] default-features = false [dependencies.hex] version = "0.4.3" [dependencies.once_cell] version = "1.4.0" [dependencies.ordered-stream] version = "0.2" [dependencies.quick-xml] version = "0.27.1" features = [ "serialize", "overlapped-lists", ] optional = true [dependencies.rand] version = "0.8.5" [dependencies.serde] version = "1.0" features = ["derive"] [dependencies.serde-xml-rs] version = "0.4.1" optional = true [dependencies.serde_repr] version = "0.1.9" [dependencies.sha1] version = "0.10.5" features = ["std"] [dependencies.static_assertions] version = "1.1.0" [dependencies.tokio] version = "1.21.2" features = [ "rt", "net", "time", "fs", "io-util", "process", "sync", "tracing", ] optional = true [dependencies.tokio-vsock] version = "0.3.3" optional = true [dependencies.tracing] version = "0.1.37" [dependencies.vsock] version = "0.3.0" optional = true [dependencies.xdg-home] version = "1.0.0" [dependencies.zbus_macros] version = "=3.14.1" [dependencies.zbus_names] version = "2.6" [dependencies.zvariant] version = "3.15.0" features = ["enumflags2"] default-features = false [dev-dependencies.async-std] version = "1.12.0" features = ["attributes"] [dev-dependencies.doc-comment] version = "0.3.3" [dev-dependencies.futures-util] version = "0.3.25" [dev-dependencies.ntest] version = "0.9.0" [dev-dependencies.tempfile] version = "3.3.0" [dev-dependencies.test-log] version = "0.2.11" features = ["trace"] default-features = false [dev-dependencies.tokio] version = "1" features = [ "macros", "rt-multi-thread", "fs", "io-util", "net", "sync", ] [dev-dependencies.tracing-subscriber] version = "0.3.16" features = [ "env-filter", "fmt", "ansi", ] default-features = false [features] async-io = [ "dep:async-io", "async-executor", "async-task", "async-lock", "async-fs", "blocking", "futures-util/io", ] chrono = ["zvariant/chrono"] default = ["async-io"] gvariant = ["zvariant/gvariant"] time = ["zvariant/time"] tokio = ["dep:tokio"] tokio-vsock = [ "dep:tokio-vsock", "tokio", ] url = ["zvariant/url"] uuid = ["zvariant/uuid"] vsock = [ "dep:vsock", "dep:async-io", ] windows-gdbus = [] xml = ["serde-xml-rs"] [target."cfg(unix)".dependencies.nix] version = "0.26.0" features = [ "socket", "uio", ] default-features = false cargo_toml_edit-0.0.2/tests/data/zstd-sys-2.0.8.Cargo.toml000064400000000000000000000033011046102023000212200ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.43" name = "zstd-sys" version = "2.0.8+zstd.1.5.5" authors = ["Alexandre Bury "] build = "build.rs" links = "zstd" include = [ "/LICENSE", "/*.*", "/src/", "/wasm-shim/**/*.h", "/zstd/LICENSE", "/zstd/COPYING", "/zstd/lib/**/*.c", "/zstd/lib/**/*.h", "/zstd/lib/**/*.S", ] description = "Low-level bindings for the zstd compression library." readme = "Readme.md" keywords = [ "zstd", "zstandard", "compression", ] categories = [ "api-bindings", "compression", ] license = "MIT/Apache-2.0" repository = "https://github.com/gyscos/zstd-rs" [package.metadata.docs.rs] features = ["experimental"] [lib] doctest = false [dependencies.libc] version = "0.2.45" [build-dependencies.bindgen] version = "0.64" features = [ "runtime", "which-rustfmt", ] optional = true default-features = false [build-dependencies.cc] version = "1.0.45" features = ["parallel"] [build-dependencies.pkg-config] version = "0.3" [features] debug = [] default = [ "legacy", "zdict_builder", ] experimental = [] fat-lto = [] legacy = [] no_asm = [] non-cargo = [] pkg-config = [] std = [] thin = [] thin-lto = [] zdict_builder = [] zstdmt = [] cargo_toml_edit-0.0.2/tests/data/zstd-sys-2.0.8.Cargo.toml.patched000064400000000000000000000032661046102023000226410ustar 00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.43" name = "zstd-sys" version = "2.0.8" authors = ["Alexandre Bury "] build = "build.rs" links = "zstd" include = [ "/LICENSE", "/*.*", "/src/", "/wasm-shim/**/*.h", "/zstd/LICENSE", "/zstd/COPYING", "/zstd/lib/**/*.c", "/zstd/lib/**/*.h", "/zstd/lib/**/*.S", ] description = "Low-level bindings for the zstd compression library." readme = "Readme.md" keywords = [ "zstd", "zstandard", "compression", ] categories = [ "api-bindings", "compression", ] license = "MIT/Apache-2.0" repository = "https://github.com/gyscos/zstd-rs" [package.metadata.docs.rs] features = ["experimental"] [lib] doctest = false [dependencies.libc] version = "0.2.45" [build-dependencies.bindgen] version = "0.64" features = [ "runtime", "which-rustfmt", ] optional = true default-features = false [build-dependencies.cc] version = "1.0.45" features = ["parallel"] [build-dependencies.pkg-config] version = "0.3" [features] debug = [] default = [ "legacy", "zdict_builder", ] experimental = [] fat-lto = [] legacy = [] no_asm = [] non-cargo = [] pkg-config = [] std = [] thin = [] thin-lto = [] zdict_builder = [] zstdmt = [] cargo_toml_edit-0.0.2/tests/tests.rs000064400000000000000000000064541046102023000156410ustar 00000000000000#![allow(missing_docs)] use std::fs; use std::path::PathBuf; use cfg_expr::targets::get_builtin_target_by_triple; use pretty_assertions::assert_str_eq; use cargo_toml_edit::{DependencyFilter, Manifest}; const NORMALIZE_FILES: [&str; 6] = [ "bzip2-sys-0.1.11", "curl-sys-0.4.66", "libgit2-sys-0.16.1", "zstd-sys-2.0.8", // noop test cases "serde-1.0.196", "syn-2.0.34", ]; const STRIP_FILES: [&str; 17] = [ "anstream-0.5.0", "backtrace-0.3.69", "bytes-1.5.0", "chrono-0.4.31", "cpufeatures-0.2.9", "gst-plugin-gtk4-0.11.0", "indicatif-0.17.7", "native-tls-0.2.11", "nix-0.27.1", "rustix-0.36.8", "time-0.3.29", "tokio-1.32.0", "which-4.4.2", "wild-2.2.0", "zbus-3.14.1", // noop test cases "serde-1.0.196", "syn-2.0.34", ]; fn old_from_prefix(prefix: &str) -> PathBuf { let mut path = PathBuf::new(); path.push(env!("CARGO_MANIFEST_DIR")); path.push("tests/data"); path.push(format!("{prefix}.Cargo.toml")); path } fn new_from_prefix(prefix: &str) -> PathBuf { let mut path = PathBuf::new(); path.push(env!("CARGO_MANIFEST_DIR")); path.push("tests/data"); path.push(format!("{prefix}.Cargo.toml.patched")); path } #[allow(clippy::expect_used)] fn default_fedora_filter() -> DependencyFilter { // default configuration for Fedora let target_triples: [&str; 7] = [ "x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu", ]; let target_triples: Vec<_> = target_triples .iter() .map(|t| get_builtin_target_by_triple(t).expect("Unknown target triple")) .collect(); let mut filter = DependencyFilter::empty(); filter.targets = target_triples; filter } #[test] fn normalize_version() { for prefix in NORMALIZE_FILES { println!("Testing: {}", prefix); let original_path = old_from_prefix(prefix); let expected_path = new_from_prefix(prefix); let original_toml = fs::read_to_string(original_path).unwrap(); let expected_toml = fs::read_to_string(expected_path).unwrap(); let mut manifest: Manifest = original_toml.parse().unwrap(); manifest.normalize_version().unwrap(); let patched_toml = manifest.to_string(); assert_str_eq!( patched_toml, expected_toml, "Mismatch with expected string for {}", prefix ); } } #[test] fn filter_dependencies() { for prefix in STRIP_FILES { println!("Testing: {}", prefix); let original_path = old_from_prefix(prefix); let expected_path = new_from_prefix(prefix); let original_toml = fs::read_to_string(original_path).unwrap(); let expected_toml = fs::read_to_string(expected_path).unwrap(); let mut manifest: Manifest = original_toml.parse().unwrap(); manifest.filter_dependencies(&default_fedora_filter()).unwrap(); let patched_toml = manifest.to_string(); assert_str_eq!( patched_toml, expected_toml, "Mismatch with expected string for {}", prefix ); } }