Use as_any to downcast inodes for updating in ext4#271
Use as_any to downcast inodes for updating in ext4#271hexagonal-sun merged 1 commit intohexagonal-sun:masterfrom
Conversation
732b5e2 to
7edfe62
Compare
| Ok(()) | ||
| } | ||
|
|
||
| fn as_any(&self) -> &dyn Any; |
There was a problem hiding this comment.
Is there a way we could provide a default implementation for this so all the trait implementations don't have to provide a boilerplate impl?
There was a problem hiding this comment.
For weird trait-bounding reasons that fails to compile. I could make it a proc macro, but that feels a little redundant.
|
I'm a bit unsure exactly what this is trying to solve. Could you expand further? |
I'm trying to mutate the inputs to various inode methods. For example: |
Solves the problem of input inodes not being updated by ext4 functions with
as_any. Since inodes on the same filesystem are equivalent we can guarantee that the downcast will not fail (if it does, the cross device error will be caught first)I'll probably do the same to
FileOpslater.