because it is cumbersome to write a bunch of code to just extract the inner variable. I have tried to use macro but it it not suitable for this case when RWLock is really required,not just for the first time assignment.
I don't see how working with a guard object returned by locking the RwLock results in any more code that needs to be written. The guards are almost as easy to use as normal references, you can dereference them, call methods in them, and so on...
Error handling must be done once - when converting LockResult<T> to T. Afterwards, ReadGuard<T> is mostly like &T, and WriteGuard<T> is mostly like &mut T. No need to try and store the reference explicitly.
You could follow various approaches here, e. g. switching to using lock_api somehow, defining a wrapper type that can be returned whose Deref(Mut) impl just does the unwrap implicitly, offering a reference only to a callback instead of via return values, using various self-referencing-datatype approaches (though that seems a bit overkill), ...