Skip to content

VirtualStorageProvider: encourage use of new_overlay or new_memory #703

Description

@arrayka

Make VirtualStorageProvider::new private.
Also add VirtualStorageProvider::new_physical<P: AsRefstd::path::Path>(path: P).
Expose only new_overlay(), new_memory(), new_physical().

Examples like these should be replaced with VirtualStorageProvider::new_memory():
let fs = OverlayFS::new(&[MemoryFS::default().into()]);
let storage_provider = VirtualStorageProvider::new(fs);

Original post:

Do you see any value in making VirtualStorageProvider::new much harder to call to encourage use of new_overlay or new_memory? Maybe with like a new_physical and then linting that with clippy?

Originally posted by Mark Hildebrand (@hildebrandmw) in #700

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions