Skip to content

Commit 0f2ea6a

Browse files
authored
Merge pull request RustPython#4994 from LucaSforza/main
Added constructor for Settings called with_path
2 parents 7069a1d + 0148683 commit 0f2ea6a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vm/src/vm/setting.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ pub struct Settings {
8282
pub profile_format: Option<String>,
8383
}
8484

85+
impl Settings {
86+
pub fn with_path(path: String) -> Self {
87+
let mut settings = Self::default();
88+
settings.path_list.push(path);
89+
settings
90+
}
91+
}
92+
8593
/// Sensible default settings.
8694
impl Default for Settings {
8795
fn default() -> Self {

0 commit comments

Comments
 (0)