Skip to content

Commit de52c00

Browse files
authored
Turbopack: Fix turbopack-swc-ast-explorer with multi-line inputs (#81635)
Previously this was only parsing the first line of input ``` cargo run -p swc-ast-explorer <turbopack/crates/turbopack-tests/tests/snapshot/comptime/assignment/input/index.js | less ```
1 parent b5f2517 commit de52c00

File tree

1 file changed

+5
-2
lines changed
  • turbopack/crates/turbopack-swc-ast-explorer/src

1 file changed

+5
-2
lines changed

turbopack/crates/turbopack-swc-ast-explorer/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use std::{io::stdin, sync::Arc};
1+
use std::{
2+
io::{Read, stdin},
3+
sync::Arc,
4+
};
25

36
use anyhow::Result;
47
use clap::Parser;
@@ -25,7 +28,7 @@ fn main() -> Result<()> {
2528
let args = Args::parse();
2629

2730
let mut contents = String::new();
28-
stdin().read_line(&mut contents)?;
31+
stdin().read_to_string(&mut contents)?;
2932

3033
let sm = Arc::new(SourceMap::default());
3134
let file = sm.new_source_file(FileName::Anon.into(), contents);

0 commit comments

Comments
 (0)