Last active
April 16, 2019 14:40
-
-
Save yoshuawuyts/eddf761c9d85d085f84ef7d7cdba1b6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +ex | |
fr() { | |
rg -l "$1" | xargs sed -i "s/$1/$2/g" | |
} | |
# setup | |
fr 'atomic_waker' 'atomic_cx' | |
# main code | |
fr 'waker' 'cx' | |
fr 'cx\.wake' 'cx\.waker\(\)\.wake' | |
fr 'Waker, Poll' 'Context, Poll' | |
fr 'Poll, Waker' 'Context, Poll' | |
fr '\&Waker' "\&mut Context<'_>" | |
fr '\&cx' 'cx' | |
fr ' w: ' ' cx: ' | |
# restore | |
fr 'atomic_cx' 'atomic_waker' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment