Skip to content

Commit

Permalink
refactor: Switch from Into to IntoData
Browse files Browse the repository at this point in the history
Prep for removing Into

Cherry pick 8daebd3 (assert-rs#292)
  • Loading branch information
epage committed May 17, 2024
1 parent 2e7258b commit 7b51216
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/snapbox/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ impl OutputAssert {

#[track_caller]
fn stdout_eq_inner(self, expected: crate::Data) -> Self {
let actual = crate::Data::from(self.output.stdout.as_slice());
let actual = self.output.stdout.as_slice().into_data();
if let Err(err) = self.config.try_eq(Some(&"stdout"), actual, expected) {
err.panic();
}
Expand Down Expand Up @@ -824,7 +824,7 @@ impl OutputAssert {

#[track_caller]
fn stderr_eq_inner(self, expected: crate::Data) -> Self {
let actual = crate::Data::from(self.output.stderr.as_slice());
let actual = self.output.stderr.as_slice().into_data();
if let Err(err) = self.config.try_eq(Some(&"stderr"), actual, expected) {
err.panic();
}
Expand Down
5 changes: 3 additions & 2 deletions crates/trycmd/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use rayon::prelude::*;
use snapbox::data::DataFormat;
use snapbox::dir::FileType;
use snapbox::filter::{Filter as _, FilterNewlines, FilterPaths, FilterRedactions};
use snapbox::IntoData;

#[derive(Debug)]
pub(crate) struct Runner {
Expand Down Expand Up @@ -584,12 +585,12 @@ impl Output {
self.spawn.status = SpawnStatus::Ok;
self.stdout = Some(Stream {
stream: Stdio::Stdout,
content: output.stdout.into(),
content: output.stdout.into_data(),
status: StreamStatus::Ok,
});
self.stderr = Some(Stream {
stream: Stdio::Stderr,
content: output.stderr.into(),
content: output.stderr.into_data(),
status: StreamStatus::Ok,
});
self
Expand Down

0 comments on commit 7b51216

Please sign in to comment.