Skip to main content

missing_import_message

Function missing_import_message 

Source
pub fn missing_import_message(names: &[&str]) -> Option<String>
Expand description

The message music21 gives when optional packages are missing, naming them and where to read how to install them: music21’s getMissingImportStr. Nothing is missing, nothing is said.

The lines after the first keep the indent music21’s source gives them.

use music21::common::misc::missing_import_message;

let message = missing_import_message(&["matplotlib"]).unwrap();
assert!(message.starts_with("Certain music21 functions might need the optional package matplotlib;"));
assert_eq!(missing_import_message(&[]), None);