refactor: Rename function to not have unneeded prefix (#5292)

This commit is contained in:
Jonathan Tran
2025-02-06 19:54:58 -05:00
committed by GitHub
parent 6ac9c49773
commit 357bbffce5
2 changed files with 7 additions and 7 deletions

View File

@ -160,7 +160,7 @@ impl Program {
/// Get the meta settings for the kcl file from the annotations.
pub fn meta_settings(&self) -> Result<Option<crate::MetaSettings>, KclError> {
self.ast.get_meta_settings()
self.ast.meta_settings()
}
/// Change the meta settings for the kcl file.

View File

@ -269,7 +269,7 @@ impl Node<Program> {
}
/// Get the annotations for the meta settings from the kcl file.
pub fn get_meta_settings(&self) -> Result<Option<crate::execution::MetaSettings>, KclError> {
pub fn meta_settings(&self) -> Result<Option<crate::execution::MetaSettings>, KclError> {
for annotation_node in self.annotations() {
let annotation = &annotation_node.value;
if annotation.annotation_name() == Some(annotations::SETTINGS) {
@ -3881,7 +3881,7 @@ const cylinder = startSketchOn('-XZ')
startSketchOn('XY')"#;
let program = crate::parsing::top_level_parse(some_program_string).unwrap();
let result = program.get_meta_settings().unwrap();
let result = program.meta_settings().unwrap();
assert!(result.is_some());
let meta_settings = result.unwrap();
@ -3897,7 +3897,7 @@ startSketchOn('XY')"#;
startSketchOn('XY')"#;
let mut program = crate::parsing::top_level_parse(some_program_string).unwrap();
let result = program.get_meta_settings().unwrap();
let result = program.meta_settings().unwrap();
assert!(result.is_some());
let meta_settings = result.unwrap();
@ -3914,7 +3914,7 @@ startSketchOn('XY')"#;
})
.unwrap();
let result = new_program.get_meta_settings().unwrap();
let result = new_program.meta_settings().unwrap();
assert!(result.is_some());
let meta_settings = result.unwrap();
@ -3939,7 +3939,7 @@ startSketchOn('XY')
async fn test_parse_get_meta_settings_nothing_to_mm() {
let some_program_string = r#"startSketchOn('XY')"#;
let mut program = crate::parsing::top_level_parse(some_program_string).unwrap();
let result = program.get_meta_settings().unwrap();
let result = program.meta_settings().unwrap();
assert!(result.is_none());
// Edit the ast.
@ -3950,7 +3950,7 @@ startSketchOn('XY')
})
.unwrap();
let result = new_program.get_meta_settings().unwrap();
let result = new_program.meta_settings().unwrap();
assert!(result.is_some());
let meta_settings = result.unwrap();