Janitor: Remove unnecessary ?

This commit is contained in:
Tobias Hunger 2021-07-08 20:53:58 +02:00 committed by Simon Hausmann
parent da324e5505
commit 287c96386e

View file

@ -354,13 +354,12 @@ impl CargoToml {
} }
fn package(&self) -> Result<&toml_edit::Table> { fn package(&self) -> Result<&toml_edit::Table> {
Ok(self self.doc
.doc
.as_table() .as_table()
.get("package") .get("package")
.map(|p| p.as_table()) .map(|p| p.as_table())
.flatten() .flatten()
.ok_or_else(|| anyhow::anyhow!("Invalid Cargo.toml -- cannot find package section"))?) .ok_or_else(|| anyhow::anyhow!("Invalid Cargo.toml -- cannot find package section"))
} }
fn dependencies<'a>(&self, dep_type: &'a str) -> Vec<(String, CargoDependency)> { fn dependencies<'a>(&self, dep_type: &'a str) -> Vec<(String, CargoDependency)> {