Skip to content

Commit

Permalink
Bump the rust-dependencies group with 5 updates (#206)
Browse files Browse the repository at this point in the history
* Bump the rust-dependencies group with 5 updates

Bumps the rust-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [chrono](https://github.com/chronotope/chrono) | `0.4.34` | `0.4.35` |
| [clap](https://github.com/clap-rs/clap) | `4.5.1` | `4.5.2` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.57` | `1.0.58` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.22.6` | `0.22.7` |
| [toml](https://github.com/toml-rs/toml) | `0.8.10` | `0.8.11` |


Updates `chrono` from 0.4.34 to 0.4.35
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](chronotope/chrono@v0.4.34...v0.4.35)

Updates `clap` from 4.5.1 to 4.5.2
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_complete-v4.5.1...v4.5.2)

Updates `thiserror` from 1.0.57 to 1.0.58
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@1.0.57...1.0.58)

Updates `toml_edit` from 0.22.6 to 0.22.7
- [Commits](toml-rs/toml@v0.22.6...v0.22.7)

Updates `toml` from 0.8.10 to 0.8.11
- [Commits](toml-rs/toml@toml-v0.8.10...toml-v0.8.11)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: toml_edit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix toml deprecation warnings

Fixes:

```
error: use of deprecated type alias `toml_edit::Document`: Replaced with `DocumentMut`
  --> src/commands/prepare_release/command.rs:14:39
   |
14 | use toml_edit::{value, ArrayOfTables, Document, Table};
   |                                       ^^^^^^^^
   |
   = note: `-D deprecated` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(deprecated)]`
```

* Refresh lockfile

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ed Morley <[email protected]>
  • Loading branch information
dependabot[bot] and edmorley authored Mar 12, 2024
1 parent a6296af commit c02d6e1
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 57 deletions.
88 changes: 44 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/commands/prepare_release/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::collections::{HashMap, HashSet};
use std::fs::write;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use toml_edit::{value, ArrayOfTables, Document, Table};
use toml_edit::{value, ArrayOfTables, DocumentMut, Table};
use uriparse::URI;

type Result<T> = std::result::Result<T, Error>;
Expand All @@ -36,7 +36,7 @@ pub(crate) enum BumpCoordinate {

struct BuildpackFile {
path: PathBuf,
document: Document,
document: DocumentMut,
}

struct ChangelogFile {
Expand Down Expand Up @@ -141,7 +141,7 @@ fn read_buildpack_file(path: PathBuf) -> Result<BuildpackFile> {
let contents =
std::fs::read_to_string(&path).map_err(|e| Error::ReadingBuildpack(path.clone(), e))?;
let document =
Document::from_str(&contents).map_err(|e| Error::ParsingBuildpack(path.clone(), e))?;
DocumentMut::from_str(&contents).map_err(|e| Error::ParsingBuildpack(path.clone(), e))?;
Ok(BuildpackFile { path, document })
}

Expand Down Expand Up @@ -400,7 +400,7 @@ mod test {
use std::collections::{HashMap, HashSet};
use std::path::PathBuf;
use std::str::FromStr;
use toml_edit::Document;
use toml_edit::DocumentMut;

#[test]
fn test_get_fixed_version() {
Expand Down Expand Up @@ -848,7 +848,7 @@ optional = true
fn create_buildpack_file_with_name(name: &str, contents: &str) -> BuildpackFile {
BuildpackFile {
path: PathBuf::from(name),
document: Document::from_str(contents).unwrap(),
document: DocumentMut::from_str(contents).unwrap(),
}
}
}
16 changes: 8 additions & 8 deletions src/commands/update_builder/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use libcnb_data::buildpack::{BuildpackId, BuildpackVersion};
use std::collections::BTreeMap;
use std::path::PathBuf;
use std::str::FromStr;
use toml_edit::{value, ArrayOfTables, Document, Item};
use toml_edit::{value, ArrayOfTables, DocumentMut, Item};
use uriparse::URI;

type Result<T> = std::result::Result<T, Error>;
Expand All @@ -27,7 +27,7 @@ pub(crate) struct UpdateBuilderArgs {

struct BuilderFile {
path: PathBuf,
document: Document,
document: DocumentMut,
}

pub(crate) fn execute(args: UpdateBuilderArgs) -> Result<()> {
Expand Down Expand Up @@ -103,12 +103,12 @@ fn read_builder_file(path: PathBuf) -> Result<BuilderFile> {
let contents =
std::fs::read_to_string(&path).map_err(|e| Error::ReadingBuilder(path.clone(), e))?;
let document =
Document::from_str(&contents).map_err(|e| Error::ParsingBuilder(path.clone(), e))?;
DocumentMut::from_str(&contents).map_err(|e| Error::ParsingBuilder(path.clone(), e))?;
Ok(BuilderFile { path, document })
}

fn update_builder_with_buildpack_info(
document: &mut Document,
document: &mut DocumentMut,
buildpack_id: &BuildpackId,
buildpack_version: &BuildpackVersion,
buildpack_uri_with_sha: &str,
Expand Down Expand Up @@ -159,7 +159,7 @@ fn update_builder_with_buildpack_info(
Ok(())
}

fn is_buildpack_using_cnb_shim(document: &Document, buildpack_id: &BuildpackId) -> bool {
fn is_buildpack_using_cnb_shim(document: &DocumentMut, buildpack_id: &BuildpackId) -> bool {
document
.get("buildpacks")
.and_then(Item::as_array_of_tables)
Expand Down Expand Up @@ -194,7 +194,7 @@ mod test {
use libcnb_data::buildpack::BuildpackVersion;
use libcnb_data::buildpack_id;
use std::str::FromStr;
use toml_edit::Document;
use toml_edit::DocumentMut;

#[test]
fn test_update_builder_contents_with_buildpack() {
Expand Down Expand Up @@ -222,7 +222,7 @@ mod test {
version = "2.0.0"
optional = true
"#;
let mut document = Document::from_str(toml).unwrap();
let mut document = DocumentMut::from_str(toml).unwrap();

update_builder_with_buildpack_info(
&mut document,
Expand Down Expand Up @@ -281,7 +281,7 @@ mod test {
id = "heroku/scala"
version = "0.0.0"
"#;
let mut document = Document::from_str(toml).unwrap();
let mut document = DocumentMut::from_str(toml).unwrap();

update_builder_with_buildpack_info(
&mut document,
Expand Down

0 comments on commit c02d6e1

Please sign in to comment.