Skip to content

Commit e9bbe0f

Browse files
committed
fix clippy
1 parent d1187d3 commit e9bbe0f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

dsc_lib/src/discovery/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ impl Discovery {
2525
///
2626
/// This function will return an error if the underlying instance creation fails.
2727
///
28+
#[must_use]
2829
pub fn new() -> Self {
2930
Self {
3031
resources: BTreeMap::new(),

dsc_lib/src/extensions/dscextension.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,14 @@ impl DscExtension {
145145
/// # Returns
146146
///
147147
/// A result containing the imported file content or an error.
148+
///
149+
/// # Errors
150+
///
151+
/// This function will return an error if the import fails or if the extension does not support the import capability.
148152
pub fn import(&self, file: &str) -> Result<String, DscError> {
149153
if self.capabilities.contains(&Capability::Import) {
150154
let file_path = Path::new(file);
151-
if self.import_extensions.as_ref().map_or(false, |exts| exts.contains(&file_path.extension().and_then(|s| s.to_str()).unwrap_or_default().to_string())) {
155+
if self.import_extensions.as_ref().is_some_and(|exts| exts.contains(&file_path.extension().and_then(|s| s.to_str()).unwrap_or_default().to_string())) {
152156
debug!("{}", t!("extensions.dscextension.importingFile", file = file, extension = self.type_name));
153157
} else {
154158
debug!("{}", t!("extensions.dscextension.importNotSupported", file = file, extension = self.type_name));

dsc_lib/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ impl DscManager {
3434
///
3535
/// This function will return an error if the underlying discovery fails.
3636
///
37+
#[must_use]
3738
pub fn new() -> Self {
3839
Self {
3940
discovery: discovery::Discovery::new(),

0 commit comments

Comments
 (0)