Skip to content

Clean up some code, add safety comments and generalize public API of UCI#21

Merged
pulsastrix merged 4 commits into
namib-project:mainfrom
MarkusPettersson98:spring-cleaning
May 5, 2026
Merged

Clean up some code, add safety comments and generalize public API of UCI#21
pulsastrix merged 4 commits into
namib-project:mainfrom
MarkusPettersson98:spring-cleaning

Conversation

@MarkusPettersson98
Copy link
Copy Markdown
Contributor

Hi, and first of all thanks for maintaining this project! Looking to interact with UCI from a project of mine, and stumbled upon this crate. Very happy to be able to write my program using Rust instead of C.

I skimmed through the code, and noticed some things that could be a bit more idiomatic. The biggest change is the type signature of set_config_dir and set_save_dir, but the change is backwards-compatible by the virtue of str implementing AsRef<Path>.

It was assumed that the &str argument containing the directory was
indeed a valid directory, which is likely but not enforced by the API.
The corresponding libuci functions are sparsely documented, but the also
assume a valid directory name.
Copy link
Copy Markdown
Member

@pulsastrix pulsastrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the Pull Request!

This change looks good to me (and is certainly an improvement over the current code), I'll go ahead and merge it.

@pulsastrix pulsastrix merged commit 852bb92 into namib-project:main May 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants