Skip to content

Commit

Permalink
Touch up PR 1737
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 23, 2024
1 parent 69fadff commit 346efae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ast_struct! {
///
/// ```
/// use std::env;
/// use std::fs::read_to_string;
/// use std::fs;
/// use std::process;
///
/// fn main() {
Expand All @@ -33,7 +33,7 @@ ast_struct! {
/// }
/// };
///
/// let src = read_to_string(&filename).expect("unable to read file");
/// let src = fs::read_to_string(&filename).expect("unable to read file");
/// let syntax = syn::parse_file(&src).expect("unable to parse file");
///
/// // Debug impl is available if Syn is built with "extra-traits" feature.
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,11 +973,11 @@ pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
///
/// ```no_run
/// use std::error::Error;
/// use std::fs::read_to_string;
/// use std::fs;
/// use std::io::Read;
///
/// fn run() -> Result<(), Box<dyn Error>> {
/// let content = read_to_string("path/to/code.rs")?;
/// let content = fs::read_to_string("path/to/code.rs")?;
/// let ast = syn::parse_file(&content)?;
/// if let Some(shebang) = ast.shebang {
/// println!("{}", shebang);
Expand Down

0 comments on commit 346efae

Please sign in to comment.