diff --git a/src/tools/collect-license-metadata/src/reuse.rs b/src/tools/collect-license-metadata/src/reuse.rs index c6a1818ce0d..a5d01935f76 100644 --- a/src/tools/collect-license-metadata/src/reuse.rs +++ b/src/tools/collect-license-metadata/src/reuse.rs @@ -17,9 +17,11 @@ pub(crate) fn collect( let mut result = Vec::new(); for file in document.file_information { + let concluded_license = file.concluded_license.expect("File should have licence info"); + let copyright_text = file.copyright_text.expect("File should have copyright text"); let license = interner.intern(License { - spdx: file.concluded_license.to_string(), - copyright: file.copyright_text.split('\n').map(|s| s.into()).collect(), + spdx: concluded_license.to_string(), + copyright: copyright_text.split('\n').map(|s| s.into()).collect(), }); result.push((file.file_name.into(), license));