Skip to content

Commit 83f1e37

Browse files
committed
wip
1 parent d4f67bc commit 83f1e37

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

crates/pet-poetry/src/pyproject_toml.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,33 @@ impl PyProjectToml {
2525

2626
fn parse(file: &Path) -> Option<PyProjectToml> {
2727
trace!("Parsing poetry file: {:?}", file);
28+
match fs::read_to_string(file) {
29+
Ok(contents) => {
30+
trace!(
31+
"Parsed contents of poetry file: {:?} is {:?}",
32+
file,
33+
&contents
34+
);
35+
}
36+
Err(e) => {
37+
error!("Error reading poetry file: {:?}", e);
38+
}
39+
};
2840
let contents = fs::read_to_string(file).ok()?;
41+
trace!(
42+
"Parsed contents of poetry file: {:?} is {:?}",
43+
file,
44+
&contents
45+
);
2946
parse_contents(&contents, file)
3047
}
3148

3249
fn parse_contents(contents: &str, file: &Path) -> Option<PyProjectToml> {
50+
trace!(
51+
"Parsing contents of poetry file: {:?} with contents {:?}",
52+
file,
53+
contents
54+
);
3355
match toml::from_str::<toml::Value>(contents) {
3456
Ok(value) => {
3557
let mut name = None;
@@ -40,6 +62,7 @@ fn parse_contents(contents: &str, file: &Path) -> Option<PyProjectToml> {
4062
}
4163
}
4264
}
65+
trace!("Successfully parsed TOML value: {:?}", value);
4366
name.map(|name| PyProjectToml::new(name, file.into()))
4467
}
4568
Err(e) => {

0 commit comments

Comments
 (0)